Skip to content

Commit

Permalink
Merge branch 'main' into feat/help/skip-version-checks-if-it-will-cau…
Browse files Browse the repository at this point in the history
…se-permission-prompts
  • Loading branch information
c4spar authored Feb 7, 2024
2 parents f54d4d7 + bcc7552 commit 855e144
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ansi/cursor_position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export interface Cursor {
export interface CursorPositionOptions {
writer?: Deno.WriterSync;
reader?: Deno.ReaderSync & {
readonly rid: number;
setRaw(mode: boolean, options?: Deno.SetRawOptions): void;
isTerminal(): boolean;
};
}

Expand Down
2 changes: 1 addition & 1 deletion ansi/tty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { Cursor, getCursorPosition } from "./cursor_position.ts";
export interface TtyOptions {
writer?: Deno.WriterSync;
reader?: Deno.ReaderSync & {
readonly rid: number;
setRaw(mode: boolean, options?: Deno.SetRawOptions): void;
isTerminal(): boolean;
};
}

Expand Down
6 changes: 3 additions & 3 deletions prompt/_generic_prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export interface GenericPromptOptions<TValue, TRawValue> {
prefix?: string;
/** Change the prompt input stream. */
reader?: Deno.Reader & {
readonly rid: number;
setRaw(mode: boolean, options?: Deno.SetRawOptions): void;
isTerminal(): boolean;
};
/** Change the prompt output stream. */
writer?: Deno.WriterSync;
Expand All @@ -87,8 +87,8 @@ export interface GenericPromptSettings<TValue, TRawValue>
cbreak: boolean;
tty: Tty;
reader: Deno.Reader & {
readonly rid: number;
setRaw(mode: boolean, options?: Deno.SetRawOptions): void;
isTerminal(): boolean;
};
writer: Deno.WriterSync;
}
Expand Down Expand Up @@ -356,7 +356,7 @@ export abstract class GenericPrompt<
/** Read user input from stdin. */
#readChar = async (): Promise<Uint8Array> => {
const buffer = new Uint8Array(8);
const isTty = Deno.isatty(this.settings.reader.rid);
const isTty = this.settings.reader.isTerminal();

if (isTty) {
this.settings.reader.setRaw(
Expand Down

0 comments on commit 855e144

Please sign in to comment.