-
This is a limitation of the HTML terminal host, not of your container or tmux setup.
OneDev's workspace terminal is an xterm.js instance in the browser. Mouse wheel scrolling works because the browser fires
wheelevents, and xterm.js forwards those to the PTY as mouse-protocol sequences when tmux has mouse reporting enabled. Touch swipes producetouchstart/touchmove/touchendinstead; they do not generatewheelevents on the terminal surface, and OneDev does not convert those touch gestures into wheel/mouse-protocol input for tmux.That is why a container that supports touch scrolling in a native terminal still fails here: the touch path never leaves the browser host. The help tip on the terminal page reflects the intended scroll method today: enter tmux copy mode with
Ctrl-bthen[, scroll with arrow keys or Page Up/Down, and pressqto exit.If touch scrolling is important for your workflow, that would need an enhancement in the browser terminal (for example translating touch pans into wheel/mouse events while tmux mouse mode is active).
-
Thank you for the explanation. Please create an implementation plan.
-
Implementation plan: touch scrolling in the workspace terminal
Goal
Make one-finger vertical swipes on the workspace terminal scroll tmux (and other mouse-aware apps) the same way mouse-wheel scrolling does today.
Scope
- In scope: browser-side change in the workspace/job terminal host (
server-core/.../web/component/terminal/terminal.js), plus updating the scroll tip onWorkspaceTerminalPage. - Out of scope: tmux/container config, server PTY / WebSocket protocol changes. Existing
SHELL_INPUT/ mouse-protocol path already works for wheel; touch just never reaches it.
Why this location
terminal.jscreates a stock xterm.js instance and forwardsonDatato the WebSocket. Wheel scrolling already works because xterm.js turnswheelevents into mouse-protocol sequences when the app enables mouse reporting. The bundled xterm does listen for touch, but that path is for its own gesture handling, not for synthesizingwheel/ mouse-wheel buttons for apps like tmux. OneDev should bridge that gap in our wrapper rather than forking xterm.Approach
- After
xterm.open(...), attachtouchstart/touchmove/touchend/touchcancellisteners on the terminal DOM element (non-passive where we needpreventDefault). - On single-finger vertical pans:
- accumulate
deltaYfrom touch movement - emit synthetic
WheelEvents (deltaMode: DOM_DELTA_PIXEL) on the xterm screen element so the existing mouse-tracking / alt-buffer wheel handlers run unchanged
- accumulate
- Gesture rules:
- ignore multi-touch (pinch / two-finger)
- ignore mostly-horizontal pans (leave page swipe / selection alone)
- use a small movement threshold so taps still focus / place the cursor
preventDefaultonly after a vertical scroll gesture is recognized, so we do not break tap-to-focus
- Keep server code (
TerminalPanel, WebSocket messages) unchanged; synthesized wheel input continues to flow asSHELL_INPUTvia xterm's normal mouse encoding. - Update the tippy help text on the terminal page to mention touch swipe when mouse mode is active, and keep the existing
Ctrl-b[copy-mode hint as a fallback.
Edge cases / acceptance
Case Expected tmux with mouse onVertical swipe scrolls history / panes like the mouse wheel vim / less (alt buffer, mouse on or wheel-as-keys) Same behavior as wheel Normal shell scrollback (no mouse mode) Touch scrolls xterm scrollback if available; otherwise no regression vs today Tap / long-press / text selection Unaffected Desktop mouse wheel Unaffected Test plan
- Touch device or browser device emulation against a workspace terminal.
- Verify tmux mouse scroll, plain shell, and that mouse wheel / keyboard still work.
- Smoke-test job terminal pages that reuse
TerminalPanel/terminal.js.
Follow-up (optional, not required for first cut)
- Tune swipe sensitivity / inertia to feel closer to native terminals.
- Consider contributing or aligning with upstream xterm.js touch→wheel behavior so a future xterm bump can replace the local bridge.
If this plan looks right, we can open an enhancement issue (or retarget this one) and implement it.
- In scope: browser-side change in the workspace/job terminal host (
-
Previous Value Current Value Open
Closed
-
| Type |
Question
|
| Priority |
Normal
|
| Assignee | |
| Labels |
No labels
|
Whilst scrolling is enabled using the mouse scroll inside Tmux inside the workspace, scrolling using touch gestures, up or down, is not enabled.
I am not sure if this is a limitation in the tmux configuration or if it is a limitation of the HTML elements that host the tmux.
However I have opened a fresh Tmux using my own container image (which definitely supports scrolling in every way, including using touch gestures) and OneDev still suffers from this problem. I expect that the issue is related to the HTML elements that host the Tmux that do not permit scrolling or any gestures inside Tmux.
Focus on the HTML first. Don't look into the tmux config for now.