Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

💡 What: Added a "Reading from standard input..." message when the CLI detects an interactive TTY session but no arguments or file input were provided.
🎯 Why: Users running commands interactively (e.g., unipept pept2lca) often think the command has hung because it silently waits for stdin. This provides immediate feedback.
📸 Before: Command hangs silently.
📸 After: Command prints "> Reading from standard input... (Press Ctrl+D to finish)" to stderr.
♿ Accessibility: Improves usability for CLI users by clarifying the application state.


PR created automatically by Jules for task 3904062231665737540 started by @bmesuere

- Detects interactive TTY sessions and prints a helpful message to stderr when the command is waiting for input.
- Prevents user confusion when running commands without arguments or pipes.
- Adds test case to verify the behavior (mocking isTTY).
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Detects interactive TTY sessions and prints a helpful message to stderr when the command is waiting for input.
- Prevents user confusion when running commands without arguments or pipes.
- Adds test case to verify the behavior (mocking isTTY).
- Handles platform-specific EOF instructions (Ctrl+Z for Windows, Ctrl+D for others).
- Verifies macOS behavior via specific test case.
@bmesuere bmesuere marked this pull request as ready for review January 16, 2026 20:30
Copilot AI review requested due to automatic review settings January 16, 2026 20:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the CLI user experience by adding a helpful message when the CLI waits for standard input in an interactive TTY session. Users running commands like unipept pept2lca interactively will now see clear feedback instead of thinking the command has hung.

Changes:

  • Added TTY detection and informative message when reading from stdin in interactive mode
  • Added comprehensive test coverage for the new functionality including platform-specific EOF key instructions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
lib/commands/unipept/unipept_subcommand.ts Added TTY detection and user-friendly message with platform-specific EOF key instructions when reading from stdin
tests/commands/unipept/unipept_subcommand.test.ts Added comprehensive tests for TTY message display across different platforms (Windows, Linux, macOS) and ensured no message appears for piped input

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Mock process.stderr.write
const stderrSpy = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);

const input = command["getInputIterator"]([]) as AsyncIterableIterator<string>;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

Unused variable input.

Copilot uses AI. Check for mistakes.

const stderrSpy = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);

const input = command["getInputIterator"]([]) as AsyncIterableIterator<string>;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

Unused variable input.

Copilot uses AI. Check for mistakes.

const stderrSpy = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);

const input = command["getInputIterator"]([]) as AsyncIterableIterator<string>;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

Unused variable input.

Copilot uses AI. Check for mistakes.

const stderrSpy = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);

const input = command["getInputIterator"]([]) as AsyncIterableIterator<string>;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

Unused variable input.

Copilot uses AI. Check for mistakes.
// Mock process.stderr.write
const stderrSpy = vi.spyOn(process.stderr, 'write').mockImplementation(() => true);

const input = command["getInputIterator"]([]) as AsyncIterableIterator<string>;
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

Unused variable input.

Copilot uses AI. Check for mistakes.
- Detects interactive TTY sessions and prints a helpful message to stderr when the command is waiting for input.
- Prevents user confusion when running commands without arguments or pipes.
- Adds test case to verify the behavior (mocking isTTY).
- Handles platform-specific EOF instructions (Ctrl+Z for Windows, Ctrl+D for others).
- Verifies macOS behavior via specific test case.
- Ensures all tests pass linting (no unused variables).
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