Repository navigation
Description
Friction
A command named in a CLI message reaches the terminal split across two lines, so copying it gives a broken command. Seen at shell start when the keyring prompt was left unanswered:
Keyring password: Keyring left locked; the next terminal you open will ask again, or run `devops
devcontainer unlock-keyring`.
Evidence
- The source string is one line (
MESSAGES.devcontainer.keyring_unlock_skipped, implicit concatenation, no\n), as AGENTS.md's "Line Breaks Belong to Source Files, Not Output" requires. devops_cli.output.console.printsends every step, raw and leveled message (print_info,print_error,print_warning,print_success,print_muted,print_step) to Rich'sConsole.printwith its defaultsoft_wrap=False. Rich then word-wraps at its own width and writes a real newline at a space, here inside the backticked command. A line the terminal wraps copies as one line; Rich's newline does not.tests/test_devcontainer.py::test_an_unanswered_prompt_leaves_the_keyring_for_the_next_terminalcollapses the output's whitespace before matching the message, working around the same break.- The message also followed the prompt on its line:
getpasswrites its newline only after an answer, so a timeout, EOF or Ctrl-C leaves the prompt's line open (_unlock_keyringinsrc/devops_cli/commands/devcontainer.py).
Remedy
Print step, raw and leveled messages with soft_wrap=True, so each reaches the terminal as one line for the terminal to wrap. Tables, panels and Markdown keep Rich's layout. End the prompt's line before the "left locked" message when the prompt is abandoned. Tests: a message wider than the console comes out as one line at every level, an abandoned prompt (timeout, EOF, Ctrl-C) is followed by the message on its own line, and the existing unanswered-prompt test matches the message without collapsing whitespace.
Proposed design
Problem statement
CLI messages that contain commands are split across multiple lines by Rich's word-wrapping, making them hard to copy and execute. Specifically, when a keyring prompt is left unanswered, the follow-up message appears on the next line after the prompt, causing a broken command when copied.
Acceptance criteria
- Criterion 1: Messages printed with Rich's Console.print have soft_wrap=True so they appear as single lines to the terminal
Verification: Run a test that prints a long message containing a command and verify it doesn't get split across lines by Rich - Criterion 2: The keyring prompt's line is properly ended before the 'left locked' message when the prompt is abandoned
Verification: Test an abandoned prompt scenario and verify the output shows the prompt on one line, followed by the message on its own line - Criterion 3: Existing tests continue to pass without modification
Verification: Run the existing test suite including test_an_unanswered_prompt_leaves_the_keyring_for_the_next_terminal
Key questions
- What is the source string for MESSAGES.devcontainer.keyring_unlock_skipped?: The source string is one line (
MESSAGES.devcontainer.keyring_unlock_skipped, implicit concatenation, no\n), as AGENTS.md's "Line Breaks Belong to Source Files, Not Output" requires. [sources: src/devops_cli/commands/devcontainer.py:1308] - How does devops_cli.output.console.print send messages to Rich?:
devops_cli.output.console.printsends every step, raw and leveled message (print_info,print_error,print_warning,print_success,print_muted,print_step) to Rich'sConsole.printwith its defaultsoft_wrap=False. Rich then word-wraps at its own width and writes a real newline at a space, here inside the backticked command. A line the terminal wraps copies as one line; Rich's newline does not. [sources: src/devops_cli/commands/devcontainer.py:1308] - What causes a command in a message to be split across lines?: Rich's default
soft_wrap=Falsecauses it to word-wrap at its own width and write a real newline at a space, splitting a command that appears on one line in the source. [sources: src/devops_cli/commands/devcontainer.py:1308] - What test currently works around this issue?: tests/test_devcontainer.py::test_an_unanswered_prompt_leaves_the_keyring_for_the_next_terminal collapses the output's whitespace before matching the message, working around the same break. [sources: src/devops_cli/commands/devcontainer.py:1308]
- What is the remedy for this issue?: Print step, raw and leveled messages with
soft_wrap=True, so each reaches the terminal as one line for the terminal to wrap. Tables, panels and Markdown keep Rich's layout. End the prompt's line before the "left locked" message when the prompt is abandoned. (proposed) [sources: src/devops_cli/commands/devcontainer.py:1308]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 16, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate fixes a bug where CLI messages are split across lines incorrectly.This is a usability issue that affects command copying but does not block functionality or introduce security risks.Improves user experience by ensuring copied commands work correctly, affecting common CLI usage patterns.The fix involves changing one parameter ('soft_wrap') in message printing and adjusting prompt handling, which is straightforward.fix(cli): messages reach the terminal as one line, so a command in on…
dan-petty commentedon Oct 16, 2026
Status set to Ready at 76dd52a (see proposed design in issue body).
dan-petty commentedon Oct 16, 2026
What changed
#1589, merged into
release/v0.2.36as eacdefa.5 file(s) changed.
How it was verified
Check runs at a53c465:
No task file.
feat(release): v0.2.36 (#1615)