1

Applications such as Tmux and Termite allow interaction with the contents of the terminal through vi-like bindings for actions such as searching and copying.

Is there any way of opening the contents of the terminal in a text editor, so that real vim can be used for such actions? Note that I am interested in opening the entire contents of the terminal in a text editor, not just the command currently being edited.

Running a terminal inside [neo]vim gives a solution close to what I would like, the main disadvantage being that it requires the foresight to have opened the terminal in vim instead of directly in my usual terminal application. Also, the vim terminal introduces linebreaks for reflowing of text, which I would prefer not to have.

I would be particularly interested in solutions that are independent of the terminal application, though maybe that is overly optimistic?

Nonnus
  • 205
  • This is probably a duplicate since others have asked how to read text from the screen (and gotten no result). – Thomas Dickey Sep 10 '18 at 20:14
  • that feature would depend on your terminal emulator and how it stores its scrollback buffer. And that output would be full of non printable characters when for instance an ncurse program is launched. Based on https://askubuntu.com/questions/690703/save-current-terminal-scrollback-to-file you can try the script command in the second answer to get a sample of what you could get. – Vincent Nivoliers Oct 05 '18 at 15:22
  • That can be done with XTerm. – Quasímodo Aug 07 '20 at 12:43

0 Answers0