Open ezh opened 2 years ago
c-d
works fine. which makes sense since all
is waiting for value output from stdin
Confirm. But isn't SIGINT should terminate STDIN as well? CTRL-D is an EOF character. The current behavior reminds me very old telnet protocol from 80-x. 🤔 If it is expected and shell should ignore CTRL-C then I'll close the ticket.
NB The SIGINT signal is sent to a process by its controlling terminal when a user wishes to interrupt the process.
Your put (all)
isn't on the RHS of a pipeline so it's reading from stdin; i.e., it's waiting for you to type something. Presumably you meant put $x | put (all)
.
At the moment signals are processed only at a couple of specific points in the REPL lifecycle and those don't include reading from stdin. TBD is how to improve signal processing. FWIW, the way Kornshell (ksh) handles this is via siglongjmp
. A truly awful mechanism from the perspective of trying to reason about the behavior of the code.
@krader1961 🙏 It is clear. Feel free to close this ticket if you think this fix/improvement is out of development scope.
Feel free to close this ticket if you think this fix/improvement is out of development scope.
The current behavior is definitely suboptimal so this issue should remain open -- at least until it is subsumed by a different issue or otherwise resolved. The current Ctrl-c behavior definitely needs improvement. I noticed this problem long ago when I started to use Elvish. I didn't open an issue because in practice it is rarely a problem for me personally and I usually recognize what I did wrong and terminate the shell via some other mechanism (e.g., closing the terminal).
I'm trying to figure out how to pass an array as an argument to the command.
And I created a statement when elvish is hanging. And the only way is
kill -9
from somewhere.That's it. After Enter, the process will stuck.
Mac x86
Could someone check, please?