I have a function (not
) that displays a notification. Hence, I can use it to show when a command is complete.
sleep 5; not
However, sometimes I forget to add ;not
. In OS X's terminal (a few years ago), I could enter a second command, while the current command was running. This second command would execute after the first had finished.
Thus, I'd type sleep 5
Enter, then immediately type not
Enter. After sleep
had terminated, not
would execute.
However, my experience in Linux is that this does not occur. After sleep
terminates, the command line shows not
, but the Enter never registers. I've tested Terminator, Konsole and a tty.
Is this behaviour dependent on the terminal emulator, and if so, are there any that work as I want? Alternatively, is there a way to make this function work in my terminal of choice (Terminator)?
Testing in different shells
Doesn't work, i.e. the second command doesn't register:
bash
bash --norc
bash --norc --noprofile
sh
Does work, i.e. the second command registers:
bash --norc --noprofile --noediting
zsh
I selectively removed lines from ~/.inputrc
and tested with my default bash
shell again. I traced the problem to the following line. When removed, the second command registers as expected.
Control-j: menu-complete
Oddly enough, if I try binding (say) Ctrl+i instead, there is no problem. Why does this entry prevent the second command from registering, and is there a way to still use Ctrl+j for menu-complete
while having the behaviour that I want for this second command?
not<Enter>
, and got back$ not notnotnot
(with that odd spacing). I get the same in Terminator.gnome-terminal
,xterm
andtty
withsh
,bash
andzsh
. All-time works for meterminator
andkonsole
, both withbash
.bash
is the problem. have a look atman termios
andPENDIN
.