Then when you later foreground the man/ less job, suddenly the paste will come through. If you try to suspend less, start another job on the same terminal, and paste into it, it will not work. the horrible thing that just happened to me): xclip will be semi-backgrounded, running as part of the less process group. The simple case of copying the entire man page reduces to g | $ x c l i p Enter. The x should be the same mark letter you used in the m command, or $ for "all the way to the end". Use the pipe command: | x which will bring up a prompt for you to enter an external command.Now scroll up so the first line you want to copy is at the top of the screen.Marks are a useful feature by themselves, and you should know them already from vi, but just in case you don't: m x sets a mark, where the x can be any letter, and ' x returns you there later. Use the m (mark) command to set a mark at your chosen end position.You can skip this step and the next step if you want to copy all the way to the end. Using whatever less commands you like, scroll up or down to position the last line you want to copy at the top of the screen.Use the | (pipe) command in less to send the text to xclip. That can be changed in xterm with the saveLines resource or -sl command line option, but I don't know of a way to change it in an xterm that's already running. Possible difficulty: your scrollback buffer may not be big enough. Button3 on your chosen end line to extend the selection.You must use only the space bar or other simple scrolling keys, not a / search - the point here is to get less to send all the lines to the terminal so they can be copied. Scroll down until the last line you want to copy is visible on the screen.triple-Button1 your chosen starting line to select it.Using whatever less commands you like, scroll up or down so the first line you want to copy is visible on the screen.Make sure less is not running with the -c option (I have this option enabled in my LESS environment variable, but it interferes with what we're about to do, so I have to type -c to turn it off.).(In xterm, it's in the menu you get with Ctrl+Button2.) Enable the scrollbar if it isn't already.Method 1 - mousey.ĭetails (assuming xterm adjustments will be required for other terminals.) I have a couple of imperfect, but maybe useful, ideas.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |