Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

copy text from tmux inside VSCode

I use VSCode on macOS, I ssh into Linux remote station and here I run tmux (inside VSCode integrated terminal). However, I am not able to copy any text from tmux into system clipboard when used like this. I am not even able to select the text using mouse - when I select any the selection highlight disappears immediately.

The copying to system clipboard works if:

  • I run tmux inside separate window of iTerm2
  • I run normal zshell inside VSC integrated terminal

How to copy text from tmux inside VSC integrated terminal?

like image 454
romanzdk Avatar asked Apr 20 '26 13:04

romanzdk


2 Answers

Solved using the mouse while holding Alt (Option) key. This way I can copy text from Tmux inside VSCode.

EDIT: You also want to set

"terminal.integrated.macOptionClickForcesSelection": true

as @hulius suggested

like image 152
romanzdk Avatar answered Apr 24 '26 04:04

romanzdk


There are answers mentioning how to set it up holding Alt key on Mac, but it didn't work for me on Linux.

Holding Shift instead of Alt worked out of the box though.

like image 20
Fjolne Yngling Avatar answered Apr 24 '26 03:04

Fjolne Yngling