New answers tagged

2

There are several solutions I found so far. I think the most stable and good is using NoMachine (built on NX protocol). You need to install one on the client which is a Windows in my case. You can get from here. And one on the server, which is Linux Debian in my case. You can get from here.


1

Instead of pasting into the terminal, have the command read from the clipboard. You can use xclip or xsel to print the clipboard content (or conversely write their input to the clipboard). xsel | perl # automatic selection (click+drag, middle click) xsel -b | perl # manual selection (Ctrl+C, Ctrl+V) This only works if the shell in the ...


1

In addition to the "solution/work-around" by Jeff Schaller , the proper solution seems to be to make the environment aware of copy-paste, both from sender side and from receiver side, which is known as "bracketed paste mode". From https://cirw.in/blog/bracketed-paste , here is a short snippet to explain a little more : In summary: Enable ...


2

This is not an answer, but maybe it's an acceptable work-around: alias p='perl; echo hit control-d again; cat > /dev/null' Then, if your perl script exits prematurely, you'll harmlessly paste the remainder to /dev/null; if the perl script succeeds, you'll see your friendly reminder and hit control-d to exit the cat catcher.


1

Ok, figured it out, I could just manipulate the different buffers directly: x-paste() { PASTE=$(pbpaste) LBUFFER="$LBUFFER${RBUFFER:0:1}" RBUFFER="$PASTE${RBUFFER:1:${#RBUFFER}}" } zle -N x-paste bindkey -M vicmd "p" x-paste


1

zsh keeps the position of the cursor in the variable CURSOR so: paste-from-clipboard () { CLIPOUT=`xclip -o` BUFFER=$LBUFFER$CLIPOUT$RBUFFER CURSOR=$(( $CURSOR + ${#CLIPOUT} )) }


4

The clipboard is not stored in the filesystem or even in a particular location in memory. In fact, there is no such thing as "the" clipboard; copy/paste is implemented via a communications protocol between applications. When you copy text in an application (whether by selecting text, for the primary selection, or by an explicit 'copy' operation for ...


0

Use file redirection to save standard out to a temporary file such as /tmp/o $ script.sh > /tmp/o Open browser such as Firefox/Iceweasel, to address: /tmp/o Now select all, copy and paste to Pastebin.org


1

You can use the tools xsel or xclip to translate from X clipboard to stdin/stdout on a terminal. If these aren't installed, they're usually available through your distro's package manager. See the man page for the relevant tool to get details on invocation.



Top 50 recent answers are included