bd0d1aaebe
This still suffers a bit if the user does manage to type anything during the invocation, because the simulated input characters get echoed to the terminal and mess up the nicely-aligned newline we just made. |
||
---|---|---|
.gitignore | ||
LICENSE | ||
README.md | ||
example.gif | ||
go.mod | ||
go.sum | ||
main.go |
README.md
missingnewline
Prints a "🚫" character and adds a newline if the cursor is not in column 1. You can use it in your shell prompt to tidy up after commands that output some text without a trailing newline.
You can install this into your ~/.bashrc
, for example:
declare -a PROMPT_COMMAND
if [ -x "${HOME}/go/bin/missingnewline" ]
then
PROMPT_COMMAND+=("${HOME}/go/bin/missingnewline")
fi