Skip to content

Opening /dev/tty requires --allow-all #31060

@thesmart

Description

@thesmart

Version: Deno 2.4.7
OS: MacOS Sequoia, maybe others?

Assume here is a hello.ts file:

const writer = Deno.openSync('/dev/tty', { read: true, write: true });
try {
  writer.writeSync(new TextEncoder().encode('Hello World!\n'));
} finally {
  writer.close();
}

Execute the file:

deno run --allow-read --allow-write --allow-env --allow-net --allow-run hello.ts

Expected Result:

Hello World!

Actual Result:

error: Uncaught (in promise) NotCapable: Requires all access to "/dev/tty", run again with the --allow-all flag
const writer = Deno.openSync('/dev/tty', { read: true, write: true });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions