Skip to content

Skip </dev/tty redirect when stdin is already a terminal#693

Merged
WhyNotHugo merged 1 commit intozk-org:devfrom
ka2u:fix/skip-dev-tty-redirect-when-stdin-is-terminal
Apr 9, 2026
Merged

Skip </dev/tty redirect when stdin is already a terminal#693
WhyNotHugo merged 1 commit intozk-org:devfrom
ka2u:fix/skip-dev-tty-redirect-when-stdin-is-terminal

Conversation

@ka2u
Copy link
Copy Markdown
Contributor

@ka2u ka2u commented Apr 8, 2026

The </dev/tty redirect was unconditionally appended to the editor command to fix vim when stdin is a pipe (see #4). However, this breaks TUI editors that use crossterm for terminal I/O (e.g. fresh) — the redirected fd causes a blank screen.

Only apply the redirect when stdin is actually a pipe, which is the only case where it is needed.

...

fixes #692

Copy link
Copy Markdown
Contributor

@WhyNotHugo WhyNotHugo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I'd just keep the comment short and concise.

@ka2u
Copy link
Copy Markdown
Contributor Author

ka2u commented Apr 9, 2026

Thank you for the review. I agree completely with your points - it was a bit wordy.

The </dev/tty redirect was unconditionally appended to the editor
command to fix vim when stdin is a pipe (see zk-org#4). However, this
breaks TUI editors that use crossterm for terminal I/O (e.g. fresh)
— the redirected fd causes a blank screen.

Only apply the redirect when stdin is actually a pipe, which is the
only case where it is needed.
@WhyNotHugo WhyNotHugo force-pushed the fix/skip-dev-tty-redirect-when-stdin-is-terminal branch from 5340d0c to 53a3732 Compare April 9, 2026 03:07
@WhyNotHugo WhyNotHugo merged commit 53a3732 into zk-org:dev Apr 9, 2026
12 checks passed
@WhyNotHugo
Copy link
Copy Markdown
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor shows blank screen with TUI editors that use crossterm (e.g. fresh)

2 participants