fix(a11y): Python terminal: screen reader output only contains the last print statement
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- accessibility, frontend
Research direction
Start in client/src/templates/Challenges/classic/xterm.tsx, focusing on the print handler and the hidden screen-reader region introduced after #60154. Reproduce the issue with three Python print() statements, then verify that the terminal region retains and exposes all output lines individually to a screen reader.
Written by the indexing model from the issue text.
Description
Describe the Issue
I am a blind user testing with a screen reader. When I run Python code with more than one print() statement, only the output of the last print() is available to my screen reader. The output of the earlier print() statements is missing.
After #60154, the terminal output is exposed to screen readers through a hidden region. However, the print handler in client/src/templates/Challenges/classic/xterm.tsx assigns textContent, which replaces the region's content on every call. Since print is called once per Python print() statement, each new line erases the previous one, so only the last line remains.
Affected Page
https://www.freecodecamp.org/learn/python-v9/workshop-report-card-printer/step-2
Steps to Reproduce
- Using a screen reader, go to the affected page.
- Replace the code in the editor with:
print("one")
print("two")
print("three") - Run the code with Ctrl+Enter.
- Navigate to the terminal. Right below the "Terminal input" edit control, there is the terminal output region.
- The screen reader only reads "three". The output "one" and "two" is not there.
Expected behavior
The screen reader should read all lines of output ("one", "two" and "three"), so screen reader users can follow the full output of their code, not only the last line.
Screenshots
No response
System
- Device: Laptop
- OS: Windows 11
- Browser: Chrome 153.0.8010.53
- Screen reader: NVDA 2026.2
Additional context
Related to #60449 and #60154.
The "console output" panel shown after running tests (Check Your Code) contains all lines, since it is regular text. The problem only affects the terminal's screen reader region, which is where the output appears immediately after running code.
I have a fix ready, tested locally with my screen reader: each print call appends a new paragraph to the region instead of replacing its content, so all lines are read and can be navigated one by one. I'd like to open a pull request for it.
- Dominant language
- TypeScript
- Stars
- 456k
- Forks
- 46.8k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 273
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from freeCodeCamp/freeCodeCamp
-
scope: curriculum status: waiting triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
freeCodeCamp/freeCodeCamp#70415 ·
Maintainers usually reply within 1 day
-
scope: curriculum status: waiting triage
Difficulty 1/5 Under an hour Newbie friendliness 78/100
freeCodeCamp/freeCodeCamp#70390 · 3 comments ·
Maintainers usually reply within 1 day
-
backend js v9 help wanted scope: curriculum
Difficulty 1/5 Under an hour Newbie friendliness 88/100
freeCodeCamp/freeCodeCamp#70389 · 2 comments ·
Maintainers usually reply within 1 day
-
js v9 cert lesson scope: curriculum status: PR in works
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
freeCodeCamp/freeCodeCamp#70248 ·
Maintainers usually reply within 1 day
-
js v9 cert scope: curriculum status: waiting triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
freeCodeCamp/freeCodeCamp#70200 ·
Maintainers usually reply within 1 day
All issues in freeCodeCamp/freeCodeCamp
Similar issues
-
resources
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
railmapgen/rmg-palette#2445 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
danielmiessler/LifeOS#2242 ·
Maintainers usually reply within 5 days
-
good first issue hacktoberfest help wanted translation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
callstackincubator/appduct#129 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100