Skip to content

Console error "Show Traceback" and "Rerun with Debug" links can't be used from the keyboard #19637

Closed

Description

@gtritchie

When an R error in the Console has a traceback, the error box shows Show Traceback and, when the failing command is known, Rerun with Debug. Both work only with the mouse. Neither can be reached with the keyboard.

Why

  • Both links are GWT Anchors with no href (src/gwt/src/org/rstudio/studio/client/common/debugging/ui/ConsoleError.ui.xml), so they aren't in the tab order.
  • Clicks are handled by one ONCLICK listener on the error box that checks the clicked element's class (ConsoleError.java). Nothing listens for keyboard input.

What keyboard users can do today

  • Show Traceback expands the call stack attached to the error. Typing traceback() at the prompt prints the same stack as console text.
  • Rerun with Debug switches the error handler to "Break in Code", then resends the failed command (Shell.onRunCommandWithDebug). It saves the previous handler (ErrorManager.previousHandlerType_), apparently to restore it after the debug session. The keyboard route is Debug > On Error > Break in Code (errorsBreak, also in the Command Palette), then Up and Enter. That changes the setting until the user changes it back. The On Error commands are rebindable="false", so they can't be given a keyboard shortcut.

Neither route can be discovered from the error itself.

Constraint: the Console traps Tab

Tab in the Console input does code completion, so a keyboard user can't Tab out to the error box. Tab only moves focus when Tab Key Always Moves Focus is on (toggleTabKeyMovesFocus, Ctrl+Alt+[ on macOS, Alt+Shift+[ elsewhere). So making the links focusable only helps users who know about that mode. Any fix has to take this into account.

Possible approaches

  1. Focusable controls. Render the links as <button> elements, or give them role="button", tabindex="0" and Enter/Space handling. Give Show Traceback aria-expanded. A native button's click bubbles to the existing listener. On its own this only helps when Tab moves focus, because of the trap above.
  2. Commands with shortcuts. Add commands such as "Show Traceback for Last Error" and "Rerun Last Command with Debug" that act on the most recent Console error. Give them shortcuts, and show the shortcuts next to the links (e.g. "Show Traceback (Ctrl+Alt+…)"). This avoids the Tab trap, puts both actions in the Command Palette, and lets them be rebound. Things to decide:
    • Which error the commands target. "Most recent error with a traceback" seems the natural choice.
    • When the commands are enabled. Rerun needs a known command, and the links only appear for errors that have a traceback.
    • Finding free shortcuts.
    • Where focus goes when the traceback expands, and how a screen reader announces it.

The two approaches can be combined: commands as the main keyboard route, plus focusable controls for users who have Tab Key Always Moves Focus on.

Related: #10086 (hover flicker on the same links).

Activity

  1. self-assigned this
    on Nov 15, 2026
  2. added theissue type on Nov 15, 2026
  3. gtritchie commented on Nov 17, 2026

    @gtritchie
    MemberAuthor

    The fix for #19645 (in progress) changes ConsoleError.setTracebackVisible() to update the label through the showTracebackText @UiField. It also drops the DOM walk, which was only needed for the virtual scroller that #16105 removed. Once Show Traceback is a button, aria-expanded can be set in that same method:

    showTracebackText.getElement().setAttribute("aria-expanded", showingTraceback_ ? "true" : "false");

    The method also runs from the constructor, so the attribute is correct from the start, including when auto_expand_error_tracebacks is on.

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions