Skip to content

fix(tty): keyboard arrow keys not working in QTerminal#225

Merged
mister-teddy merged 2 commits intolocaldesktop:mainfrom
ArcheoCodix:fix/tty-keyboard
Apr 7, 2026
Merged

fix(tty): keyboard arrow keys not working in QTerminal#225
mister-teddy merged 2 commits intolocaldesktop:mainfrom
ArcheoCodix:fix/tty-keyboard

Conversation

@ArcheoCodix
Copy link
Copy Markdown
Contributor

fix: keyboard arrow keys not working in QTerminal

Arrow keys (↑ ↓ ← →) were not working inside QTerminal.

The root cause was two redundant proot bind mounts: --bind=/dev/pts:/dev/pts and --bind=/dev/ptmx:/dev/ptmx. Since --bind=/dev already covers all of /dev including its subdirectories, these explicit sub-binds caused proot to double-translate PTY ioctls (TIOCGPTN, TIOCSPTLCK, TIOCSWINSZ), which broke terminal initialisation inside QTerminal.

Changes:

  • Remove the redundant /dev/pts and /dev/ptmx binds (covered by --bind=/dev)
  • Add --bind=/dev/tty:/dev/tty explicitly, as some processes open it by path

The explicit --bind=/dev/pts:/dev/pts and --bind=/dev/ptmx:/dev/ptmx
(added in upstream commit 61d9079 "fix: missing terminal") were redundant
because --bind=/dev already covers all of /dev including its subdirectories.

Having both caused proot to double-translate PTY ioctls
(TIOCGPTN/TIOCSPTLCK/TIOCSWINSZ), which broke terminal initialisation
inside QTerminal and made keyboard arrow keys stop working.

Fix: remove the redundant sub-binds. Add --bind=/dev/tty:/dev/tty
explicitly since some processes open /dev/tty by path rather than
using the inherited file descriptor.

TERM=xterm-256color is unchanged: infocmp confirms that xterm and
xterm-256color have identical smkx/kcuu1 sequences. Arrow keys work
via readline's hardcoded CSI bindings (\e[A) regardless of cursor mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@FBarrca
Copy link
Copy Markdown
Contributor

FBarrca commented Apr 6, 2026

I think this is not really needed. Doesn't it work if you enable the accessibility service?
It is working flawlessly for me now.

@ArcheoCodix
Copy link
Copy Markdown
Contributor Author

Because of my security overlay, I can't enable accessibility in the app since it's not from the Play Store.
It seems more effective to fix the problem directly rather than use a workaround, don't you think?
Could the proposed change cause any issues?
I don't think the two fixes would conflict with each other.

@mister-teddy mister-teddy self-requested a review April 7, 2026 18:09
@mister-teddy mister-teddy added release:bugfix Assign this label to a PR to bump the patch semver version for the next release. release:feature Assign this label to a PR to bump the minor semver version for the next release. and removed release:bugfix Assign this label to a PR to bump the patch semver version for the next release. labels Apr 7, 2026
@mister-teddy
Copy link
Copy Markdown
Contributor

I don't think the two fixes would conflict with each other.

Me too 👍 The more the merrier 😂

@mister-teddy mister-teddy merged commit e1f13e0 into localdesktop:main Apr 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:feature Assign this label to a PR to bump the minor semver version for the next release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants