lablup / backend.ai

Backend.AI is a streamlined, container-based computing cluster platform that hosts popular computing/ML frameworks and diverse programming languages, with pluggable heterogeneous accelerator support including CUDA GPU, ROCm GPU, TPU, IPU and other NPUs.
https://www.backend.ai
GNU Lesser General Public License v3.0
502 stars 150 forks source link

Support easier text copy from tmux terminal #172

Open adrysn opened 4 years ago

adrysn commented 4 years ago

Recently, tmux is introduced as the default terminal interface. After that, copy texts from the terminal is nearly impossible for users (paste to the terminal is okay). Drag by mouse does not copy the texts, and Ctrl-Space in copy mode (which can be entered by Ctrl-B, [) does not either seem to be working. Even if tmux's copy mode works, it would be hard for users to actually use it, aside from the fact that the copy mode copies the texts to tmux's internal buffer, not system clipboard.

I think eaiser copy should be supported for smoother user experiences. I don't know how to introduce this feature, currently, but maybe some of the following will work.

achimnol commented 4 years ago

Currenty we can copy-and-paste texts by mouse dragging or the tmux copy mode, but only inside the terminal. Ctrl-B :paste pastes the copied text. The problem is that tmux keeps the copied text in its own buffer, not the user's clipboard through the web browser.

achimnol commented 4 years ago

Let's just set set -g mouse off as the default tmux configuration, and specify the default behavior of tmux+ttyd in our user manuals.

The new default behavior:

If the user manually enables the mouse using Ctrl+B :set -g mouse on, then all mouse interactions including text selection and scrolling are delegated to tmux, and the user looses copy & paste capability with the user-side system clipboard but becomes able to scroll the tmux buffer with mouse wheels.

Unfortunately, currently there is no way to turn off mouse-based text selection while turning on mouse-based scroll at the same time in the tmux configuration because they are tied under a single option.