Termix-SSH / Termix-SSH/Support

[FEATURE] Clipboard settings for the terminal: right-click behaviour selector + copy-on-select

Open
#1,250 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature platform-web ssh ui
Dominant language
No language data
Stars
28
Forks
4
PR merge metrics
No merged PRs in 30d

Description

Title

Clipboard settings for the terminal: right-click behaviour selector + copy-on-select

Platform

Website

Is it related to an issue?

Copying and pasting in the web terminal currently takes more steps than in any other SSH client, and there is no setting to change that.

Pasting. Since the terminal context menu was added (Termix-SSH/Termix#695 — "replace silent copy/paste with visual context menu"), a plain right-click always opens the Termix menu. The pre-#695 silent behaviour still exists in the code and still honours the "Enable right-click copy/paste" setting, but it is only reachable with Shift+right-click, which is documented nowhere in the UI. The existing option is a plain on/off toggle, and neither position gives silent paste on a plain right-click:

  • ON -> the Termix context menu opens (Copy / Paste / Open File Manager Here)
  • OFF -> the event falls through to the browser's own menu

So the toggle reads as broken: it is named "Enable right-click copy/paste", it is switched on, and a normal right-click still shows a menu instead of pasting.

Copying. Selecting text does not put it on the clipboard. After highlighting, a second explicit action is always required (context menu -> Copy, or a keyboard shortcut). In PuTTY, xterm, Termius and most terminal emulators, selection alone copies.

Together these turn the most common loop in a terminal — copy something, paste it somewhere — into four actions where other clients need two. For anyone working in the terminal all day, that adds up.

The Solution

Add a small "Clipboard" block to Settings -> Terminal, next to the other terminal preferences (theme, font, cursor), with two controls:

Right-click behaviour     [ Context menu               v ]
                            * Context menu  (default)
                            * Copy / paste silently
                            * Browser menu

Copy on select            [ off ]  (default off)

Right-click behaviour

  1. Context menu — exactly today's behaviour, kept as the default so nothing changes for existing users on upgrade. Right-click opens the Termix menu with Copy, Paste and "Open File Manager Here".
  2. Copy / paste silently — the pre-#695 behaviour: with a selection, right-click copies it; with no selection, it pastes. No menu. The context menu stays available on Ctrl+right-click, which the terminal handler already implements, so "Open File Manager Here" (the original motivation for #695) is not lost.
  3. Browser menu — the browser's native menu, for Inspect / Save as.

Copy on select

When enabled, releasing the mouse after a selection copies it to the clipboard immediately, the way PuTTY and xterm behave. Combined with "Copy / paste silently" above, this gives the classic terminal workflow: select to copy, right-click to paste, nothing else. Default off, so current behaviour is preserved unless the user opts in.

This half overlaps with #1215, which asks for highlight-to-copy. That request is about the mechanism; this issue asks for both clipboard behaviours to be user-selectable settings and to live in one place, so they can be reasoned about together rather than each being a separate hardcoded decision.

Storage and migration

The setting already exists as rightClickCopyPaste in localStorage and is read as ye('rightClickCopyPaste') !== 'false' — anything but the string "false" counts as enabled. The same key can hold three string values (menu / silent / browser), with old values mapped on first read: absent or "true" -> menu, "false" -> browser. Existing installs then keep precisely the behaviour they have today, with no prompt and no surprise. "Copy on select" would be a new boolean key, default false.

Both settings are per-user, stored with the other terminal appearance options rather than per-host — the habit belongs to the person, not to the server being connected to.

Effort

The right-click part looks small: the terminal's own contextmenu handler already contains all three branches, and today they are chosen by modifier keys. The request is to let the setting decide which branch a plain right-click takes, keeping the modifiers as overrides.

Additional Context

Tested on Termix 2.7.1, Docker, served over HTTPS behind nginx, so the Clipboard API is fully available and neither behaviour is blocked by browser security.

Workarounds until then, for anyone who finds this issue by search:

  • Shift+right-click performs the old silent copy/paste (copies a selection, pastes when there is none).
  • Ctrl+V and Ctrl+Shift+V paste; they are handled by a separate paste listener that the context menu does not shadow.

Related issues, none of them duplicates:

  • #1215 — asks for highlight-to-copy plus right/middle-click paste. The "Copy on select" half of this request is the same idea; the difference is that this issue proposes both clipboard behaviours as explicit settings in one block, with the right-click selector alongside.
  • #683 — the 2.2.0 regression where the browser menu appeared instead of copy/paste, fixed by Termix-SSH/Termix#750. The present case is the Termix menu appearing by design, which is why this is a feature request rather than a bug report.
  • #1026 — pasting over plain HTTP, fixed in 2.7.0. Unrelated to this request: everything above is with HTTPS and a working Clipboard API.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the terminal settings alongside the existing terminal appearance options, then trace the terminal contextmenu handler, the ye('rightClickCopyPaste') localStorage read, and the separate paste listener. Done means both controls persist per user, old values migrate as described, and plain right-click, modifier overrides, and copy-on-select follow the three requested behaviours.

Written by the indexing model from the issue text.

Assessment

Tech stack
web-dev
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.