Skip to content

Commit 46d5b42

Browse files
committed
Simplify TTY detection slightly further
: is a bash built-in equivalent to 'true', which does nothing, but still checks the TTY because it's still given the redirection.
1 parent 7959707 commit 46d5b42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notes

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

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

207-
if bash -c "printf '' >/dev/tty" >/dev/null 2>/dev/null; then
207+
if bash -c ": >/dev/tty" >/dev/null 2>/dev/null; then
208208
$EDITOR "$note_path" </dev/tty
209209
else
210210
$EDITOR "$note_path"

0 commit comments

Comments
 (0)