mirror of
https://github.com/itchyny/mmv.git
synced 2025-12-26 22:24:58 +08:00
parent
fec2c9b389
commit
467ba873c3
1 changed files with 1 additions and 8 deletions
|
|
@ -98,14 +98,7 @@ func rename(args []string) error {
|
|||
}
|
||||
defer tty.Close()
|
||||
|
||||
editor := os.Getenv("EDITOR")
|
||||
if editor == "" {
|
||||
editor = "vi"
|
||||
}
|
||||
editorWithArgs := strings.Fields(editor)
|
||||
editorWithArgs = append(editorWithArgs, f.Name())
|
||||
|
||||
cmd := exec.Command(editorWithArgs[0], editorWithArgs[1:]...)
|
||||
cmd := exec.Command("sh", "-c", `eval exec "${EDITOR:-vi}" '"$@"'`, "", f.Name())
|
||||
cmd.Stdin = tty.Input()
|
||||
cmd.Stdout = tty.Output()
|
||||
cmd.Stderr = tty.Output()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue