Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

Use a shell to spawn $EDITOR #80

rafl opened this issue Mar 5, 2013 · 1 comment
Labels
Milestone

Comments

@rafl
Copy link

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.

@theory
Copy link
Collaborator

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 added a commit that referenced this issue May 11, 2013
Will use them for the editor in the next commit (ref issue #80).
@theory theory closed this as completed in 4802240 May 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants