Skip to content

Error message terminal commands #544

Open

Description

@mandy-apperkeeper

Hey Mr. Abels,

It would be super awesome to have the commands in error messages in a copy block, they are currently not "highlight-able" to copy them into the terminal and run them. screenshot for reference:

Image

Activity

  1. knipknap commented on Oct 10, 2026

    @knipknap
    Contributor

    Thanks for the suggestion, and for including the screenshot — that makes it easy to see exactly what you mean.

    You're right. Some of the error messages (for example the ones about serial port permissions) include commands like sudo snap connect ... that you're meant to run in a terminal, but the text in the message is rendered as a plain label that can't be selected or copied. So at the moment the only option is typing the command by hand, which is both annoying and error-prone.

    I agree this should be fixed. The plan is to make command lines inside these messages selectable and/or add a one-click "copy" button next to them, so you can paste them straight into the terminal. I can't promise a release date, but it's on the list now and I'll keep this issue open until it ships.

  2. added
    rca-doneA root cause analysis was attached
    and removed on Oct 10, 2026
  3. mandy-apperkeeper commented on Oct 10, 2026

    @mandy-apperkeeper
    Author

    what if you ran a terminal from rayforge?

  4. switch87 commented on Oct 17, 2026

    @switch87
    Contributor

    A fix for this is ready on my fork, but this account can no longer open pull requests on this repo — the API rejects CreatePullRequest — so I cannot put it up as a PR myself. The complete diff is here:

    https://github.com/barebaric/rayforge/compare/main...switch87:fix/544-copyable-error-commands?expand=1

    If you open the PR from that link (or grant push rights so I can), here is what it does:

    • Error messages that hand the user something to run in a terminal no longer arrive as a wall of text: the prose stays in the row or banner that carries it, and every command becomes a one-click copy row underneath it.
    • Both surfaces that show the serial permission failure from the screenshot are covered: the setup wizard's probe page, and machine settings → General under the error banner.
    • rayforge/ui_gtk/shared/command_row.py (new) holds CommandRow, lifted out of the permissions pre-flight page unchanged, so the wizard's copy row and these two surfaces are one widget instead of two.
    • split_commands(message) pulls the trailing command block out of a free-form message. Messages introduce their commands with a blank line, and a block is only taken when every line of it looks like something to type — anything not clearly a command is shown exactly as it is written today. A message shown wrongly would be worse than one without a copy button.
    • The messages themselves are untouched: every message id in rayforge/locale/** stays valid, no translation is invalidated, and the commands stay verbatim in all six languages.

    Checks: ruff format, ruff check, flake8, pyflakes clean; pyright reports only this machine's pre-existing from gi.repository import … stub noise (also on main). New tests in tests/ui_gtk/test_command_row.py and tests/ui_gtk/machine/test_general_preferences_page.py, a new probe-page case in test_unified_wizard.py, plus the whole -m ui run.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    rca-doneA root cause analysis was attached

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions