Live data from Hacker News

Yank: Yank Terminal Output to Clipboard

github.com

1–10 of 57 posts

Re: Yank: Yank Terminal Output to Clipboard

#2
Back in the day, on the Amstrad CPC, there was a way to duplicate the cursor, move the duplicate around on any part of the screen and copy any text below the duplicate to where the actual cursor was. I always thought that this simple but powerful feature was missing on modern computers.

The submission is not equivalent but clearly can help avoid having to move your mouse around. Still wish I didn't have to modify the original command as, very often, I realize that I want to copy the command's output after I execute it.

Re: Yank: Yank Terminal Output to Clipboard

#4
post #2

Back in the day, on the Amstrad CPC, there was a way to duplicate the cursor, move the duplicate around on any part of the screen and copy any text below the duplicate to where the actual cursor was. I always thought that this simple but powerful feature was missing on modern computers. The submission is not equivalent but clearly can help avoid having to move your mouse around. Still wish I didn't have to modify the…

In iterm2, with shell integration enabled, hitting Command-Shift-A selects all the output since the last prompt.

Re: Yank: Yank Terminal Output to Clipboard

#5
You can do this with tmux too.

    ~/.tmux.conf:

    # export to clipboard.
    bind-key > run-shell -b 'tmux save-buffer - | xclip'
    # paste from clipboard.
    bind-key 
(edit: my actual setup is slightly different. It interacts with a Windows clipboard via ssh where the terminal is running. cf. https://github.com/euske/pyrexecd/blob/master/tools/tmux.con... )

Re: Yank: Yank Terminal Output to Clipboard

#7
post #2

Back in the day, on the Amstrad CPC, there was a way to duplicate the cursor, move the duplicate around on any part of the screen and copy any text below the duplicate to where the actual cursor was. I always thought that this simple but powerful feature was missing on modern computers. The submission is not equivalent but clearly can help avoid having to move your mouse around. Still wish I didn't have to modify the…

I built some of those kinds of cursors features into my terminal. http://extraterm.org/features.html

It is never too late to steal features that the Commodore 64 could do in the early 80s (!!!).

oh, Extraterm can help you reuse previous output after the fact and without having to be clairvoyant.

Re: Yank: Yank Terminal Output to Clipboard

#8
Very cool tool!

Two immediate thoughts: one, the naming had me confused for a while. The only place I've seen the word "yank" in computing is in Emacs context, where it means "paste", not "copy"...

Two, natural extension of this idea is "interactively select and transform data in the pipe". I think existing text editors would be natural fit for this, especially if configured with some conveniences (like field-based navigation and ability to delete everything except a particular column/line with one command). Then, you could drop such editor into a pipe using something like [0]. I'm gonna try this with terminal Emacs client at some point.

--

[0] - https://stackoverflow.com/a/49289440

Re: Yank: Yank Terminal Output to Clipboard

#9
post #8

Very cool tool! Two immediate thoughts: one, the naming had me confused for a while. The only place I've seen the word "yank" in computing is in Emacs context, where it means "paste", not "copy"... Two, natural extension of this idea is "interactively select and transform data in the pipe". I think existing text editors would be natural fit for this, especially if configured with some conveniences (like field-based n…

> The only place I've seen the word "yank" in computing is in Emacs context, where it means "paste", not "copy"...

This is a confusing difference between Emacs and Vim. Emacs uses it for pasting, Vim uses it for copying.

Re: Yank: Yank Terminal Output to Clipboard

#10

On Mac OS, a much less powerful but built in tool is `pbcopy`.

To replicate pbcoby on X11 systems, add to your bashrc:

    alias clip="xclip -selection clipboard"
`echo hello | clip` will copy 'hello' to the clipboard, and similarly `ls | clip` will copy a bunch of lines to the clipboard. You might need to install xclip through your package manger (the package is just named xclip on Arch).
Post reply on HN