Si! Thanks so much for helping with your answer! I was able to solve my problem based on your solution. Is SIGINT what is triggered by default when a new line event occurs? So handling the SIGINT event did the trick?
No worries mate - glad it was helpful. I've never actually used readline, so it was a good opportunity to give it a spin 😁.
SIGINT is the interrupt signal. The terminal sends it to the foreground process when the user presses ctrl-c. We handle this signal so we can gracefully shut down rl (rl.pause()).
line is the event that is triggered when a new line occurs. I would assume that the default behaviour of a new line is to call rl.pause() but we're capturing the event instead and doing our own thing.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Si! Thanks so much for helping with your answer! I was able to solve my problem based on your solution. Is
SIGINTwhat is triggered by default when a new line event occurs? So handling theSIGINTevent did the trick?No worries mate - glad it was helpful. I've never actually used
readline, so it was a good opportunity to give it a spin 😁.SIGINTis the interrupt signal. The terminal sends it to the foreground process when the user pressesctrl-c. We handle this signal so we can gracefully shut downrl(rl.pause()).lineis the event that is triggered when a new line occurs. I would assume that the default behaviour of a new line is to callrl.pause()but we're capturing the event instead and doing our own thing.