Repository navigation
Description
Problem
Keyboard users can only move into the Console output as a whole. Focus Console Output (Ctrl+Alt+2, or Alt+Shift+2 on Windows and Linux) focuses the most recent output, and Tab reaches the output region. There's no way to step back through earlier output (for example, the result of the command before last) without a mouse or a screen reader's own virtual cursor.
Background
The output region (#rstudio_console_output) is a <pre tabindex="0">. Inside it, each prompt cycle (the echoed command and its output) is a <span tabindex="-1" role="document"> chunk (ConsoleOutputWriter.outputToConsole()). A new chunk starts each time a prompt is written (ShellWidget calls ensureStartingOnNewLine()). Focus Console Output focuses the last chunk with content (ConsoleOutputWriter.focusEnd()).
After #19812, focus on a chunk outlines the whole output region, because an outline on an inline chunk traces each wrapped line.
Proposal
- Show which chunk has focus. Draw a rectangle around the focused chunk, and keep the whole-region outline for when the
<pre>itself has focus. Making chunksdisplay: blockshould give a rectangle without moving text, since each chunk starts on a new line. Check for extra blank lines from a chunk's trailing newline, for doubled newlines when copying across chunks, and that line trimming and the find bar still work. - Move between chunks with the keyboard. While a chunk has focus, keys move focus to the previous or next chunk with content, optionally announcing the position (e.g. "Output 3 of 12").
- The WAI-ARIA feed pattern is a close fit: Page Down / Page Up move between articles, and Ctrl+End / Ctrl+Home leave the feed. Today Page Up/Down, Home and End scroll the output, and most other keys are sent to the console input (Up/Down recall history), so the key handling in
ShellWidget'sSelectInputClickHandlerwould need to change while a chunk has focus. - Chunks have
role="document"because of JAWS virtual cursor is not auto-activated in Console Output region #6884 (JAWS's virtual cursor wasn't activated in the output). Any role change (e.g. to feed articles) needs testing with JAWS, NVDA and VoiceOver; screen reader support for feeds is uneven. - Global commands (e.g. Focus Next / Previous Console Output) could also be added so the navigation works from outside the output, but they need shortcuts and a defined starting point when focus is in the input.
- The WAI-ARIA feed pattern is a close fit: Page Down / Page Up move between articles, and Ctrl+End / Ctrl+Home leave the feed. Today Page Up/Down, Home and End scroll the output, and most other keys are sent to the console input (Up/Down recall history), so the key handling in
Keys, wording and roles are still to be decided.
Activity
gtritchie commentedon Nov 25, 2026
How VS Code handles this
From VS Code's current documentation (not tried hands-on). VS Code doesn't make individual output sections focusable. Its integrated terminal has two separate mechanisms, one for sighted keyboard users and one for screen reader users. The Debug Console, its closest equivalent to the RStudio Console, has no documented way to move between output items.
Terminal: jumping between commands (needs shell integration, on by default)
Terminal: Accessible View (for screen readers)
Debug Console (the REPL)
What this suggests for RStudio
role="document"sections, and avoids the JAWS issue in JAWS virtual cursor is not auto-activated in Console Output region #6884.Sources: