Repository navigation
Replies: 2 comments 3 replies
|
Great feedback, there's obvious tension between the two use cases simple editor vs ide and I'm trying to make them both natural. I think a few small tweaks should make it better |
3 replies
|
Improved in 0.5.4, thanks for bringing this up |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I don't use Fresh as an IDE (I use another editor for that), but as a replacement for micro or helix: I set it in
EDITORandVISUAL, use it to edit my git commit messages, and open files from my terminal file manager. I also ship it as the default terminal editor in my personal Linux distribution, so any configuration I apply here carries over to other users’ systems.I sense this isn't the primary use case for Fresh, as it seems to be used mainly as an IDE, though I may be mistaken. Yet, this usage pattern demands fewer capabilities, and precisely that “fewer” is what I seek: open the file it is given, let me edit and save it, then exit. No daemon, no workspace, no dock, no history. Ideally, this would work seamlessly from the start: set
freshasEDITOR, use it with git, and be done.In version 0.5.3, this doesn't quite work yet. The welcome screen and the homepage suggest using
git config --global core.editor "fresh --wait", which results in the errorunexpected argument '--wait'. Instead,fresh --helpadvises configuringgit config core.editor 'fresh --cmd daemon open-file . --wait', which brings the session machinery along: the daemon restores and saves the repository's workspace, and neither the--no-restoreflag nor therestore_previous_sessionsetting affects this behaviour, causinggit committo reopen files from the prior session as tabs next toCOMMIT_EDITMSG.Pressing Ctrl+Q during a daemon session offers the Detach option as the default. Once detached, the daemon continues operating until one full hour passes without any active client connection. If a
git commitis issued in the same repository within that hour, the file is handed over to the daemon: git then hangs, awaiting an editor that nobody can see.Invoking
fresh --no-restore FILEdirectly comes much closer: it operates within the calling process and blocks until you exit, eliminating the need for git to use--waitentirely. However, it continues to load every workspace file at launch (approximately 900 in my case), opens the dock by default, writeschrome.jsonupon termination, and, whenhot_exitis enabled, restores the unsaved state left by a prior session in the same directory. Thus, my current approach involves a wrapper that executesexec fresh --no-restore "$@", along with these keys in the user config,{ "orchestrator_mode": false, "editor": { "hot_exit": false }, "plugins": { "orchestrator": { "enabled": false }, "live_sessions": { "enabled": false } } }and a one-time
rm ~/.local/share/fresh/workspaces/*.jsoncommand. This approach functions correctly, and Fresh starts fast again, yet requires understanding of internal mechanics, a custom wrapper script, and a manual cleanup – the opposite of "it just works".What I would prefer is a first-class plain mode, ideally activated via a single switch in the global config, such as
"session_mode": "none"(the name serves merely as a placeholder). With it set:gh, or external session sources) is disabled;freshcommand does not attach to a shared daemon.Per-file cursor memory can stay; it costs little and provides practical value. Part of this functionality already exists through distinct settings, as demonstrated by the configuration shown above. What is missing is a configuration-level equivalent of
--no-restorethat additionally bypasses the workspace scan, along with a single toggle that consolidates all these behaviours.With such a switch, setting
EDITOR=freshandgit config core.editor freshwould function directly, eliminating the need for a wrapper, and the welcome screen, the homepage, and the--helpoutput could all recommend the identical option. For people who use Fresh both ways, a flag would cover it per invocation, such asEDITOR="fresh --plain". While git and numerous other tools permit arguments in that context, a configuration option also serves those that expect a bare program name.Some challenges encountered along the way might warrant individual issues, and I'm happy to file any of them separately. Upon upgrading to 0.4.6, a migration turned each of my 875 old
scratch-<pid>session files into a standalone workspace. The dock displays every workspace and probes each one usinggit status, along withgit diffandgh pr viewwithin Git repositories; the loop caps concurrent Git probes, but does not restrictghinvocations. This resulted in roughly 90 processes per second for me while the dock remained active, and one daemon's log expanded to approximately 5 GB in under a day, with debug-level logging enabled by default. Finally, saving settings via a temporary file followed by a rename replaces a symlinkedconfig.jsonwith a regular file.All reactions