forked from pimterry/notes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously this was bugged, incorrectly using -z so that the check never passed, and $EDITOR was always run without having the TTY injected as an input. This causes problems with command-line editors like Vim, which need an interactive input (and output) to be usable. Meanwhile, attempting to inject /dev/tty as the input in all cases causes problems in CI, because there is no TTY available in GitHub Actions, and presumably in other scripted environments. Fixing this with -e does not work, as /dev/tty exists but unopenably in many environments. Instead, we use printf in a subshell to test whether /dev/tty is actually usable, and then only use it if it is.
- Loading branch information
Showing
2 changed files
with
47 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters