Skip to content
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

promptSecret() prints redundant lines for long inputs #6306

Open
kawmra opened this issue Dec 26, 2024 · 1 comment · May be fixed by #6318
Open

promptSecret() prints redundant lines for long inputs #6306

kawmra opened this issue Dec 26, 2024 · 1 comment · May be fixed by #6318
Labels
bug Something isn't working

Comments

@kawmra
Copy link

kawmra commented Dec 26, 2024

Describe the bug

promptSecret() prints too many lines if inputs exceeds console width.

Steps to Reproduce

import { promptSecret } from "jsr:@std/cli";

promptSecret()

then, if input long lines, it prints like:

Secret *************************************************************************
Secret *************************************************************************
Secret *************************************************************************
***

Expected behavior

Prints no extra lines like:

Secret *************************************************************************
***

Environment

  • OS: macOS 14.6.1
  • deno version: 2.1.4
  • std version: 2024-12-18 (@std/cli v1.0.9)
@kawmra kawmra added bug Something isn't working needs triage labels Dec 26, 2024
@kt3k kt3k removed the needs triage label Dec 27, 2024
@cosmastech
Copy link

cosmastech commented Dec 30, 2024

Is there already a function to get the terminal width? Or would we use a control sequence like "\u001b[18t"?

edit: nevermind, we have Deno.consoleSize() 😃

@cosmastech cosmastech linked a pull request Dec 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants