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

Resizing terminal causes promptSecret to crash #6319

Open
finleyjb opened this issue Dec 31, 2024 · 1 comment
Open

Resizing terminal causes promptSecret to crash #6319

finleyjb opened this issue Dec 31, 2024 · 1 comment
Labels
bug Something isn't working upstream Changes upstream are required to solve these issues

Comments

@finleyjb
Copy link
Contributor

Describe the bug

promptSecret appears to crash if I resize my terminal

Steps to Reproduce

  1. Open deno repl
  2. Run import { promptSecret } from "jsr:@std/cli"; promptSecret();
  3. See the secret prompt
  4. Resize your terminal window

This gives the following error:

Uncaught Interrupted: Interrupted system call (os error 4)
    at readSync (ext:deno_io/12_io.js:37:22)
    at Stdin.readSync (ext:deno_io/12_io.js:138:12)
    at readLineFromStdinSync (file:///home/fin/src/std/cli/prompt_secret.ts:85:21)
    at promptSecret (file:///home/fin/src/std/cli/prompt_secret.ts:65:12)
    at <anonymous>:1:22

Expected behavior

The promptSecret function should continue to run without throwing an error

Environment

This is running in the Tabby command-line app accessing Deno in a WSL Debian environment. I have not verified it in any other environments, so it might be a quirk due to this specific setup.

  • OS: Windows 11 24h2, Debian 12
  • deno version: 2.1.4
  • std version: @std/cli v1.0.9
@finleyjb finleyjb added bug Something isn't working needs triage labels Dec 31, 2024
@finleyjb
Copy link
Contributor Author

It looks like the root cause is Deno.stdin.readSync. The following also crashes if I resize the terminal.

> let buf = new Uint8Array(100);
> Deno.stdin.readSync(buf);

Note that this only seems to be a problem with the repl. If I run the following script and resize my terminal, it works as expected:

let buf = new Uint8Array(100);
Deno.stdin.readSync(buf);

@kt3k kt3k added upstream Changes upstream are required to solve these issues and removed needs triage labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Changes upstream are required to solve these issues
Projects
None yet
Development

No branches or pull requests

2 participants