Selecting text in terminal without using the mouse

≯℡__Kan透↙ 提交于 2019-12-03 03:38:08

问题


If I'm working in a terminal window in Linux, is there a keyboard shortcut I can use to select output displayed on previous lines? If I select something with the mouse I can copy using Ctrl + Shift + C, but is there a way to select without using the mouse at all. I'm using either Gnome terminal or KDE konsole in Ubuntu desktop.

For example I often need to copy results from a mysql query and then google them.


回答1:


You can use the screen application and enter copy mode with Ctrl+a, Esc. Start selecting text with Space and end selecting text with Space. Insert text with Ctrl+a, ]




回答2:


Daniel Micay's Termite sports a "selection mode". Pressing Ctrl+Shift+Space will activate it. It's got vim-like key bindings. v or V will select à la vim's visual mode, y will yank, Esc will exit selection mode.




回答3:


Screen and Emacs M-x shell, for example, allow for keyboard access to the scrollback buffer. This was also one of the features of Plan 9 (but I guess it was mouse-oriented, at least primarily); you might want to take a look at 9term and/or Sam, the Plan 9 editor.



来源:https://stackoverflow.com/questions/1536757/selecting-text-in-terminal-without-using-the-mouse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!