This repository has been archived by the owner on Apr 13, 2024. It is now read-only.
Only exit the shell if Ctrl-C is pressed with an empty input #71
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #65.
Handle this in readline(), so that we can respond to it by cancelling the current command input, or (later) terminating a command that is currently executing.
Though, other shells seem to instead only exit if the
exit
command is run, or sometimes ifCtrl-D
is entered. Might want to come back to this eventually.Also, this is only implemented for Node CLI. I didn't know where to start with making Puter's terminal exit correctly. 😅
This also made me notice that Ctrl-C on a previous history item will erase that item. I didn't manage to fix that in the end, but did make some small improvements to the history code while I was there.