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?

  • 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 askubuntu.com/questions/690703/… you can try the script command in the second answer to get a sample of what you could get. – Vincent Nivoliers Oct 5 '18 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.