fossil commit tries to launch "notepad" on linux
(1.2) By Franklin Brauning (fbrauning) on 2025-05-31 12:58:19 edited from 1.1 [link] [source]
I recently updated version 2.26 and commit fails attempting to launch "notepad". The "editor" setting and $EDITOR environment variable are empty.
fos ci
notepad ./ci-comment-6B0E2645AF06.txt
/usr/bin/notepad: line 46: /usr/bin/wine: No such file or directory
editor aborted: "notepad ./ci-comment-6B0E2645AF06.txt"
Fossil 2.25 and all previous versions launch "vi" on linux. This "notepad" actually exists on my system but I dont have wine installed (hence the error) but still why launch notepad which is not a native linux editor when we have vi, vim, nano or even gedit. Is this a regression?
(2) By Stephan Beal (stephan) on 2025-05-31 13:04:33 in reply to 1.2 [source]
Fossil 2.25 and all previous versions launch "vi" on linux.
It still does, but only if it doesn't find "notepad" - the latter is earlier in the search lists.
See /help/editor for how to configure it.
(3) By Mike Swanson (chungy) on 2025-06-05 05:41:03 in reply to 1.2 [link] [source]
The fact you're getting such an error also suggests that you have a broken or complete installation of Wine.
(4) By Andy Bradford (andybradford) on 2025-06-05 17:10:37 in reply to 1.2 [link] [source]
> Fossil 2.25 and all previous versions launch "vi" on linux. Are you sure it would launch "vi" without you having told it to do so? > Is this a regression? That depends on how one looks at it I suppose. Fossil's behavior certainly has changed in this regard: https://fossil-scm.org/home/info/fc60e44417e8437c Prior to this change, Fossil was mostly agnostic and would provide an editor-less alternative to entering a comment (e.g. enter a comment followed by a dot on a line by itself). One did not have to configure an editor if one was satisfied with the rudimentary entry of comments without an editor. Now Fossil tries to pick an editor for the user from among the most common editors. Perhaps notepad should not be at the head of the list of the OS is not Windows? You'll have to set EDITOR or VISUAL or make sure that notepad (and all the other defaults that Fossil now tries) isn't in your PATH prior to other better alternatives. You can see the order of preference here: https://fossil-scm.org/home/file?udc=1&ci=trunk&name=src%2Futil.c&ln=685 Andy
(5) By Daniel Dumitriu (danield) on 2025-06-05 17:37:14 in reply to 4 [link] [source]
Perhaps notepad should not be at the head of the list of the OS is not Windows?
That is a false problem. Fossil checks first if those programs are on PATH, and as we saw, notepad was there - but could not be run (in general, so neither from shell) because of the missing wine bits. That makes it one pretty particular system, for which it is reasonable to use one of those other three available solutions (you forgot the "editor" setting) instead of modifying Fossil and starting to play with #ifdef
s.
One could maybe think about pushing notepad further back in that list, yet I assume the OP case is rare enough that we mustn't.
(6) By Andy Bradford (andybradford) on 2025-06-05 19:21:11 in reply to 5 [link] [source]
> That is a false problem. Perhaps so. Still, this new behavior introduced some surprises for some people, no doubt. > for which it is reasonable to use one of those other three available > solutions (you forgot the "editor" setting) instead Yes, you're right, and if a user has a Debian variant system and they have correctly configured their default editor, they could use /usr/bin/editor as the configuration for their editor in Fossil: https://wiki.debian.org/TextEditor If we don't want #ifdefs for Windows (arguably we do not), then we might do better by making "editor" the first in the list rather than notepad? It's no more esoteric than trying "notepad" on Linux. At least on Debian variants, /usr/bin/editor is a symbolic link to /etc/alternatives/editor, which is in turn a link to the proper default editor for that system. Otherwise, Fossil's built in list of default editors is likely in conflict with what the user is accustomed to on those systems. Andy