version-controlfossil

Unable to commit with fossil scm


Recently I could not commit due to the following error:

$ fossil commit
$EDITOR './ci-comment-CEA221250987.txt'
Unsafe command string: $EDITOR './ci-comment-CEA221250987.txt'
              here ----^
Aborted (core dumped)

Is this a fossil issue or do I have some rogue configuration in my .bashrc ?


My fossil version is

$ fossil version
This is fossil version 2.12.1 [b98ce23d4f] 2020-08-20 13:27:04 UT

And $EDITOR is

$ echo $EDITOR
vim

Solution

  • What does "fossil setting editor" say? Do you have it set to $EDITOR? Don't do that. It is a security risk. The error arises because Fossil detected that security risk and refused to proceed. Instead, set the editor directly to "vim" like this:

    fossil setting editor vim
    

    Or, do "fossil unset editor" so that the VISUAL and EDITOR environment variables will be consulted at runtime.

    Note: In the above, you might need to add the --global option to the various "setting" and "unset" commands, in case you have "editor" set globally.