Skip to content

Conversation

@sj26
Copy link
Member

@sj26 sj26 commented Jul 8, 2025

Extracted from #499, this just slightly enhances the built-in confirm process to fail with a clear message in non-terminal environments.

Amp-Thread: https://ampcode.com/threads/T-96c672dc-7e75-4174-b20e-b6bff5e074d5

sj26 and others added 2 commits July 9, 2025 08:08
- Confirm function now fails by default in non-TTY environments
- Shows helpful error message suggesting to use -y/--yes flag
- Maintains existing behavior for TTY environments
- Adds comprehensive test coverage for new behavior

Amp-Thread: https://ampcode.com/threads/T-96c672dc-7e75-4174-b20e-b6bff5e074d5
Co-authored-by: Amp <[email protected]>
- Add TTY wrapper functions in internal/io package
- Replace direct isatty usage with IsTerminal()
- Centralize TTY detection logic for easier testing and future changes
- Update all tests to use the new wrapper functions
- isatty package now only imported in one place

Amp-Thread: https://ampcode.com/threads/T-96c672dc-7e75-4174-b20e-b6bff5e074d5
Co-authored-by: Amp <[email protected]>
@sj26 sj26 requested a review from a team as a code owner July 8, 2025 22:13
@sj26 sj26 mentioned this pull request Jul 8, 2025
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.

3 participants