Workspace web terminal clipboard copy and paste fail with basic shell commands #3261
WanderWang opened 23 hours ago

Summary

In OneDev 17.0.0, the Workspace web terminal does not handle a terminal application's OSC 52 clipboard write. Pressing Ctrl+V can also reach the application as byte 0x16 instead of pasting browser clipboard text. These cases can be tested with only tmux, printf, and Python. No third-party TUI is needed.

Reproduce clipboard copy

  1. Open a Workspace terminal in the OneDev web UI. OneDev starts its Workspace shell inside tmux.

  2. Run these commands in that terminal:

    tmux set -g allow-passthrough on
    printf '\033Ptmux;\033\033]52;c;T05FREVWLUNMSVBCT0FSRC1URVNU\a\033\\'
    

    The OSC 52 payload is the UTF-8 text ONEDEV-CLIPBOARD-TEST.

  3. Paste into a normal browser text field outside the terminal.

Expected: the text field receives ONEDEV-CLIPBOARD-TEST.

Actual: the browser clipboard is not updated. The Workspace terminal code does not load xterm.js's ClipboardAddon or register an OSC 52 handler. The test uses tmux passthrough to send OSC 52 to the browser terminal without relying on an application's copy implementation.

Reproduce text paste

  1. Copy the literal text PASTE-TEST from this issue into the browser clipboard.

  2. In the Workspace web terminal, run:

    python3 -c 'import os,termios,tty; fd=os.open("/dev/tty",os.O_RDONLY); old=termios.tcgetattr(fd); tty.setraw(fd); b=os.read(fd,1); termios.tcsetattr(fd,termios.TCSADRAIN,old); print("first byte:",b.hex())'
    
  3. Press Ctrl+V once.

Expected: first byte: 50, the UTF-8 byte for P in the copied text.

If the terminal sends the key as a control character instead, the output is first byte: 16. This was observed in an isolated browser run of OneDev's bundled xterm.js. The full Workspace web page and different browser/OS combinations still need verification.

Code location

server-core/src/main/java/io/onedev/server/web/component/terminal/terminal.js loads only the Fit and WebGL addons. Its xterm.onData callback forwards terminal input as SHELL_INPUT without clipboard-specific handling. The output path decodes SHELL_OUTPUT and writes it to xterm.js.

The terminal.js bundled in the deployed OneDev 17.0.0 server was byte-for-byte identical to upstream main when checked on 2026-11-15.

  • WanderWang changed title 23 hours ago
    Previous Value Current Value
    Workspace web terminal does not copy TUI text or paste clipboard text into Codex
    Workspace web terminal clipboard copy and paste fail with basic shell commands
1/1
Type
Bug
Priority
Normal
Assignee
Affected Versions
17.0.0
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-3261
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover