Skip to content

Commit 15f870e

Browse files
committed
Allow use of 'notes open' when no TTY is available
This is useful for a) our automated tests but also b) any scripting of notes. You probably don't want to open an editor in your terminal in that case, but you could plausibly end up running 'notes open' at some point anyway and it's nice if it doesn't crash at least.
1 parent 457466d commit 15f870e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

notes

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,11 @@ open_note() {
204204

205205
note_path=$( get_full_note_path "$note_path" )
206206

207-
$EDITOR "$note_path" < /dev/tty
207+
if [[ -z "/dev/tty" ]]; then
208+
$EDITOR "$note_path" < /dev/tty
209+
else
210+
$EDITOR "$note_path"
211+
fi
208212
}
209213

210214
append_note() {

0 commit comments

Comments
 (0)