You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TLDR is that when the application terminates in unexpected ways (or really just ctrl+c) it's pretty easy for the terminal to be left in an unfortunate state. While there might be ways in which APIs can be restructured to cause this less, this is generally quite unfortunate and too easy to cause.
It also will in most cases require either using raw inputs to ensure that ctrl+c is manually handled on all inputs to reset the terminal state locally or (more correctly) to handle cltr+c globally. The latter however requires the user to be involved here as there can really only be one handler via the ctrlc crate or similar.
As a strawman proposal I'm considering adding a helper that people can put into their own ctrlc handlers which resets the terminal back to the state it was in when the application was started.
What's kind of ironic here is that the actual terminal settings are usually already properly reset, what's not reset is the cursor which is not in the terminal state that is manipulated via normal operations. Instead the cursor is hidden and shown via ANSI codes and there is no reasonable way to query the state of that.
So in a way what would need to be done is to carefully manage the cursor state within console/dialoguer independently. I'm really not sure what the most reasonable approach is here.
This came out of the issue filed over at dialoguer: console-rs/dialoguer#294
The TLDR is that when the application terminates in unexpected ways (or really just ctrl+c) it's pretty easy for the terminal to be left in an unfortunate state. While there might be ways in which APIs can be restructured to cause this less, this is generally quite unfortunate and too easy to cause.
It also will in most cases require either using raw inputs to ensure that ctrl+c is manually handled on all inputs to reset the terminal state locally or (more correctly) to handle cltr+c globally. The latter however requires the user to be involved here as there can really only be one handler via the
ctrlc
crate or similar.As a strawman proposal I'm considering adding a helper that people can put into their own ctrlc handlers which resets the terminal back to the state it was in when the application was started.
The text was updated successfully, but these errors were encountered: