Skip to content

Add --no-alternate-screen (-X) flag#417

Open
ev1lm0nk3y wants to merge 2 commits into
walles:masterfrom
ev1lm0nk3y:main
Open

Add --no-alternate-screen (-X) flag#417
ev1lm0nk3y wants to merge 2 commits into
walles:masterfrom
ev1lm0nk3y:main

Conversation

@ev1lm0nk3y
Copy link
Copy Markdown
Contributor

@ev1lm0nk3y ev1lm0nk3y commented May 20, 2026

I was experiencing issues when moor was being used when interactive prompts were required by external cli tools.

  • Implement --no-alternate-screen (alias -X) to disable switching to the alternate screen buffer.
  • Ensure AwaitFirstByte is called for all stream inputs to protect interactive prompts.
  • Refactor twin library to support screen options.
  • Update public embedding API with NoAlternateScreen option.

- Implement --no-alternate-screen (alias -X) to disable switching to the alternate screen buffer.
- Add SIGINT and SIGTERM handling to ensure terminal state is restored on exit.
- Ensure AwaitFirstByte is called for all stream inputs to protect interactive prompts.
- Refactor twin library to support screen options.
- Update public embedding API with NoAlternateScreen option.
@walles
Copy link
Copy Markdown
Owner

walles commented May 23, 2026

Do you think you could split this into two PRs?

  • One for ensuring AwaitFirstByte is called for all stream inputs to protect interactive prompts.
  • One for skipping the alternate screen

That would simplify review conversations a lot!

@ev1lm0nk3y
Copy link
Copy Markdown
Contributor Author

ev1lm0nk3y commented May 23, 2026 via email

walles added a commit that referenced this pull request May 29, 2026
This is the signal handling part of
#417.
@walles walles changed the title Add --no-alternate-screen (-X) flag and improve signal handling Add --no-alternate-screen (-X) flag May 31, 2026
@walles
Copy link
Copy Markdown
Owner

walles commented May 31, 2026

I merged signal your signal handling changes separately and dropped them from this PR.

I made sure your name ended up in git blame for the signal code:

https://github.com/walles/moor/blame/5599cb4ceadfae4d457e6eaf53ec0689010f74ea/cmd/moor/moor.go#L741-L762

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.

2 participants