Merge pull request #10 from tgfjt/master

This commit is contained in:
itchyny 2020-09-18 19:48:30 +09:00 committed by GitHub
commit 485dd72d9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -100,7 +100,11 @@ func rename(args []string) error {
return err
}
defer tty.Close()
cmd := exec.Command(editor, f.Name())
editorWithArgs := strings.Fields(editor)
editorWithArgs = append(editorWithArgs, f.Name())
cmd := exec.Command(editorWithArgs[0], editorWithArgs[1:]...)
cmd.Stdin = tty.Input()
cmd.Stdout = tty.Output()
cmd.Stderr = tty.Output()