Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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...)

share|improve this question

3 Answers 3

up vote 1 down vote accepted
+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.

share|improve this answer

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

share|improve this answer
    
This does not work with a vertically-split screen –  TheNobleSunfish Aug 13 at 15:01

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.