Skip to content

Commit 64ad7f4

Browse files
apragamcDevnagh
andauthored
Windows support to edit new files (#502)
Co-authored-by: Michael McDonagh <[email protected]>
1 parent e939463 commit 64ad7f4

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

internal/adapter/editor/editor.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (e *Editor) Open(paths ...string) error {
3939
// initial note content to `zk new`. Without this, Vim doesn't work
4040
// properly in this case.
4141
// See https://github.com/zk-org/zk/issues/4
42-
cmd := executil.CommandFromString(e.editor + " " + shellquote.Join(paths...) + " </dev/tty")
42+
cmd := executil.CommandFromString(e.editor + " " + shellquote.Join(paths...) + CMD_SUFFIX)
4343
cmd.Stdin = os.Stdin
4444
cmd.Stdout = os.Stdout
4545
cmd.Stderr = os.Stderr
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//go:build windows
2+
3+
package editor
4+
5+
const CMD_SUFFIX = ""

internal/adapter/editor/suffix.go

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//go:build !windows
2+
3+
package editor
4+
5+
const CMD_SUFFIX = " </dev/tty"

0 commit comments

Comments
 (0)