-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(cli): Handle overflow in promptSecret
#6318
base: main
Are you sure you want to change the base?
Conversation
promptSecret
promptSecret
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6318 +/- ##
=======================================
Coverage 96.36% 96.36%
=======================================
Files 547 547
Lines 41731 41755 +24
Branches 6325 6331 +6
=======================================
+ Hits 40212 40238 +26
+ Misses 1478 1476 -2
Partials 41 41 ☔ View full report in Codecov by Sentry. |
Thanks for the PR. This looks much better than the current state! However if I filled the first 2 lines and then deleted the entire 2nd line, then the initial prompt part was duplicated again.. Could you take a look at this point as well? (I guess we can use 'Cursor Control' codes to remove the entire prompt + masks https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797#cursor-controls) |
Absolutely! Two thoughts:
edit: While I think a CliWindow utility class may be helpful, it's not strictly necessary to close this ticket. |
@kt3k I believe your issue is addressed. I've updated the description to include a screen recording of the current implementation. There's still an issue where resizing the screen after prompting causes undesirable behavior. In order to fix this, we need to keep track of the console size and check it before writing anything to the terminal. Is calling Deno.consoleSize() an expensive operation, or is it safe to do on each character press? An example of what happens when resizing a terminal window: deno-promptSecret_with-screen-resize.mov |
e507994
to
355515c
Compare
355515c
to
64a40a9
Compare
To close #6306
There is an issue where backspacing characters from multiple lines will not move the cursor back to the original lines. I welcome any input on how to improve this, or if it's necessary.
deno-promptSecret_2.mov