8

When using GNU Screen with OS X (presumably with Linux also) and use a vertical split screen, how do you copy-paste text on just one side of the full terminal?

Is not being able to do this something that people live with or is there a script/function that can paste just the first or last 80 characters of each line or something like that?

(I installed the latest GNU Screen from the git repository for my OS X 10.7 if that matters...)

3 Answers 3

4
+100

If you are restricted to only using screen, then the solution is like this (also works for non-split or horizontally-split screen windows):

  • Use crtl+a [ to go into copy mode
  • navigate using the arrow keys or hjkl keys (vi-style)
  • use space to mark the start of your selection
  • use space to mark the end of your selection, copy to screen's buffer and exit copy mode
  • use ctrl+a ] to paste

Fancier movement keys (e.g. move to start of line/buffer) can be found here.

If you are not restricted to using the vanilla OSX terminal + screen, you may want to try some terminal that natively supports vertical splitting and run a separate screens on the left and right vertical panels. One terminal that supports this is iTerm2.

With terminal-supported vertical splits you can copy-paste using the mouse as-usually. You will still have to use the screen shortcuts to copy stuff from the screen scrollback buffer.

If you go with iTerm2, then you may also consider ditching screen altogether and switch to this version of Tmux. Tmux is a replacement for screen. The customized version above seamelessly integrates with iTerm2. I.e. opening/closing new screens is handled with iTerm2 shortcuts, and the scrollback buffer is directly accessible without having to switch to some special tmux mode.

3

On Linux, hold CTRL+SHIFT and select a block of visible text using mouse.

1
  • 1
    This does not work with a vertically-split screen Aug 13, 2014 at 15:01
1

Try holding down Alt and selecting the text with the mouse cursor. Command+V should paste then.

2
  • Just tried this on OSX and it doesn't work.
    – mprat
    May 31, 2017 at 15:26
  • Try Shift instead Alt May 31, 2017 at 15:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .