Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Use a shell to spawn $EDITOR #80

Closed
rafl opened this Issue Mar 5, 2013 · 1 comment

Comments

Projects
None yet
2 participants

rafl commented Mar 5, 2013

When ever a commit message of some sort is required, sqitch will attempt to spawn an editor if the user hasn't already provided his commit message on the command line:

$ sqitch tag v0.0.1
"emacsclient -t" failed to start: "No such file or directory"

Sqitch seems to attempt to spawn the editor the user configured in his environment, which is great.

However, it also appears to attempt to do so by a plain exec, which is problematic in two ways:

$ echo $EDITOR
emacsclient -t

It won't do what you expect if $EDITOR contains more than just the name of an executable, such as an editor invocation that provides arguments to the editor

$ which emacsclient
emacsclient: aliased to TERM=xterm-256color emacsclient

And it won't resolve possible aliases configured in the user's shell either.

It'd be great if opening a visual editor would be performed through a shell rather than by a simple exec.

Owner

theory commented Mar 5, 2013

Hrm. The two places that currently run the editor both do so like this:

$sqitch->run( $sqitch->editor, $file );

The run method uses IPC::System::Simple::runx. Maybe there should be a separate method for running things specified in the environment? I'm not sure. This will also be an issue for running other command-line clients (like psql).

@theory theory added a commit that referenced this issue May 11, 2013

@theory theory Add `shell()` and `quote_shell()`.
Will use them for the editor in the next commit (ref issue #80).
d1629ff

@theory theory closed this in 4802240 May 11, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment