Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot copy/paste in integrated terminal running tmux #209191

Closed
rmgpinto opened this issue Mar 30, 2024 · 10 comments
Closed

Cannot copy/paste in integrated terminal running tmux #209191

rmgpinto opened this issue Mar 30, 2024 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member *duplicate Issue identified as a duplicate of another issue(s) terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc.

Comments

@rmgpinto
Copy link

In my terminal, Alacritty, I simply select the text I want to copy and the selection goes automatically to my clipboard.
It doesn't work in VSCode's Integrated Terminal running tmux.

I've tried the following options without success:
"terminal.integrated.macOptionClickForcesSelection": true
"terminal.integrated.rightClickBehavior": "nothing"

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.87.2 arm64
  • OS Version: MacOS Sonoma 14.4.1

Steps to Reproduce:

  1. open VSCode
  2. open Integrated Terminal
  3. run tmux
  4. try to copy-paste text with mouse

My tmux.conf:

set  -g default-terminal "screen-256color"
set -g status-keys vi
set -g mode-keys   vi
unbind C-b
set -g prefix C-a
set  -g mouse             on
setw -g aggressive-resize on
setw -g clock-mode-style  24
set  -s escape-time       500
set  -g history-limit     2000
@meganrogge
Copy link
Contributor

I think you're looking for this? terminal.integrated.copyOnSelection

@rmgpinto
Copy link
Author

rmgpinto commented Apr 1, 2024

it works on VSCode integrated terminal, but once I start a tmux session it doesn't work.

@meganrogge meganrogge reopened this Apr 1, 2024
@meganrogge meganrogge added the terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc. label Apr 1, 2024
@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member labels Apr 1, 2024
@duncanawoods
Copy link

duncanawoods commented Apr 12, 2024

I am also seeing this on Ubuntu 22.04.04, vscode 1.88.0, tmux 3.2a

Holding down shift while selecting works though.

@studgeek
Copy link

studgeek commented May 20, 2024

I'm seeing this also on vscode 1.89.1 tmux 3.3a on mac in remote session to linux. I can't seem to select text with mouse using any combination of modifier keys.

@studgeek
Copy link

Interestingly, in my case I can select if I am using tmux inside vscode integrated terminal inside a bottom pane of original window.
But once I move it to a detached window using "Move Terminal into New Window" I can no longer select text.
If I drag that terminal back into bottom pane of original window then I can select again.

@studgeek
Copy link

Note related issue was reported and fixed in earlier vscode in #192518.

@studgeek
Copy link

In my case I found that "terminal.integrated.macOptionClickForcesSelection": true allows me to select in detached window also. It still seems weird that behavior is different between in-pane and detached though...

@studgeek
Copy link

Actually, I do still see a behavior difference between once a terminal is detached.
When in pane I can mouse select text with no modifier key. Once detached I can't select with no modifier key. I have to have "terminal.integrated.macOptionClickForcesSelection": true and also press Option to select.
If I move terminal back in pane then I can select text with no modifier key again.

@Yujif1Aero
Copy link

neither me. My vscode in wsl2 is

 $ code -v
1.89.1
dc96b837cf6bb4af9cd736aa3af08cf8279f7685
x64

tmux is

$ tmux -V
tmux 3.2a

wsl2 is

wsl -v
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3593

My tmux setting is set for emacs user.
As to copy the shell commands, I use emacs ~/.bash_history in tmux.

@Tyriar
Copy link
Member

Tyriar commented Jun 3, 2024

/duplicate #193508

@Tyriar Tyriar closed this as completed Jun 3, 2024
@vscodenpa vscodenpa added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 3, 2024
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jul 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member *duplicate Issue identified as a duplicate of another issue(s) terminal-input Relating to typing in the terminal not doing the right thing, IMEs not working, etc.
Projects
None yet
Development

No branches or pull requests

7 participants