mirror of
https://github.com/mickael-menu/zk
synced 2024-11-07 15:20:21 +00:00
Fix #4 terminal borked when piping content with Vim
This commit is contained in:
parent
c58e68e0e2
commit
ec574ff519
@ -16,6 +16,10 @@ All notable changes to this project will be documented in this file.
|
||||
* By setting `ZK_NOTEBOOK_DIR` in your shell configuration file (e.g. `~/.profile`), you are declaring a default global notebook which will be used when `zk` is not in a notebook.
|
||||
* When the notebook directory is set explicitly, any path given as argument will be relative to it instead of the actual working directory.
|
||||
|
||||
### Fixed
|
||||
|
||||
* [#4](https://github.com/mickael-menu/zk/issues/4) Terminal borked when piping content with Vim
|
||||
|
||||
|
||||
## 0.2.1
|
||||
|
||||
|
@ -20,7 +20,11 @@ func Edit(zk *zk.Zk, paths ...string) error {
|
||||
return fmt.Errorf("no editor set in config")
|
||||
}
|
||||
|
||||
cmd := executil.CommandFromString(editor.String() + " " + shellquote.Join(paths...))
|
||||
// /dev/tty is restored as stdin, in case the user used a pipe to feed
|
||||
// initial note content to `zk new`. Without this, Vim doesn't work
|
||||
// properly in this case.
|
||||
// See https://github.com/mickael-menu/zk/issues/4
|
||||
cmd := executil.CommandFromString(editor.String() + " " + shellquote.Join(paths...) + " </dev/tty")
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
Loading…
Reference in New Issue
Block a user