Questions tagged [xsel]

xsel is a command line tool for manipulating the 'clipboard' in an X Window System environment.

xsel is a command line tool for operating upon the X Window System selection.

20 questions
18
votes
2 answers

`tee` for commands

tee can redirect the piped standard input into the standard output and file. echo Hello, World! | tee greeting.txt The command above would display the greeting on the terminal screen and save it in the contents of greeting.txt file, creating the…
user86041
9
votes
3 answers

xsel: Can't open display: (null)

I want to copy a long file into clipboard with xsel,in my local pc ,just input: cat /usr/bin/mysql_secure_installation|xsel -b The file mysql_secure_installation located in my local os was copied into clipboard. Now login to my vps with ssh…
showkey
  • 79
  • 23
  • 67
  • 128
9
votes
2 answers

xsel and xclip hang

My objective is to make a text on my remote machine (CentOS 7.2) available to seamlessly paste on my local machine (OS X 10.12.2) with the standard ⌘V shortcut. My setup connects to the remote machine with ssh -Y and then attaches to tmux (or…
Kvass
  • 221
  • 1
  • 5
8
votes
2 answers

To which stream does xsel print the no newline warning?

xsel is a program with which you can access system clipboard from command line. If there is no newline at the end of copied content, it prints a warning after the clipboard content like this: $ xsel -b copied text \ No newline at end of…
saga
  • 1,381
  • 11
  • 36
4
votes
1 answer

xbindkeys Paste Script is Failing to Work

I'm trying to bind control + i to load the contents of file.txt to the clipboard (so that I can use ctrl + v to paste the contents of file.txt into windows like my browser). The following command works perfectly if I manually type it into a bash…
PP1211
  • 41
  • 1
4
votes
3 answers

Copy vim selected text to system clipboard

My vim is not compiled with clipboard feature. So, i use xsel as suggested by Gilles to copy/paste the contents. I use :.w !xsel -b for selecting the current line and, :w !xsel -b to select the entire document. But sometimes, i need to move…
user93868
3
votes
1 answer

Copying text with Ctrl + C when the Zsh line editor is active

I've added some keyboard shortcuts in my Zsh to enable selecting words. In order for the selection to do something, I would like to use Ctrl + C to copy it. However I would also like to use Ctrl + C to interrupt programs, when the Zsh Line Editor…
simonzack
  • 713
  • 4
  • 17
3
votes
1 answer

Piping search term from clipboard (not filename) to grep to search a folder

I am trying to use xsel clipboard to pipe search term to grep to search in folder full of txt files. Can anybody suggest a method to do it.
Ramaprakasha
  • 215
  • 1
  • 7
3
votes
0 answers

xsel not deleting selected text

I have been trying to get xsel --delete to work to ultimately implement a script to move selected material from one editor to another. According to the description: Delete the contents of the selection ------------------------------------ …
Timo
  • 6,202
  • 1
  • 26
  • 28
2
votes
0 answers

How to paste selection from vi-mode to clipboard

I want to access the content of what I copied in the buffer with the vi-mode of the clipboard via the command ctrl + v or ctrl + shift + v in the terminal. I copied in my .zshrc the following: (from this answer: Pasting from clipboard to vi-enabled…
ecjb
  • 379
  • 3
  • 12
2
votes
2 answers

Linux clipboards, including with WSL consoles

It occurred to me that there are multiple clipboards on any given Linux console: First is the bash clipboard, this can be invoked by Ctrl-U / K, cut all line before (U) or after (K) cursor into clipboard, or Ctrl-W, to cut the word on the left side…
YorSubs
  • 601
  • 5
  • 13
2
votes
1 answer

zsh - optimize copy, cut, paste using ctrl+c, ctrl+x, ctrl+v

I am using the following config in my .zshrc. if [[ -t 0 && $- = *i* ]] then # change Ctrl+C to Ctrl+I stty start '' stty stop '' stty quit '' stty erase '' stty kill '' stty eof '' # Ctrl + D stty rprnt '' stty werase '' stty lnext '' stty discard…
Ahmad Ismail
  • 2,478
  • 1
  • 22
  • 47
1
vote
1 answer

How to run command when user push ctrl+c?

User selects any text and push ctrl+c. How to autorun command after this action? I need solutions for: How to get notification/check about the state of the clipboard After notification/check will autorun command I haven't idea.
69 420 1970
  • 375
  • 3
  • 17
1
vote
1 answer

How to avoid xsel sending text to clipboard with space/Enter at the end

I am trying to answer this other question: Command/script to start a terminal, enter text but don't execute.... I want to start the terminal and add specific text to it without executing, thus allowing me to copy some other variable text to it…
cipricus
  • 1,386
  • 13
  • 42
1
vote
1 answer

How to get clipboard as input file name to Vim on bash?

I install xclip to access system clipboard, my setting and some operations as below: ➜ ~ cat .zshrc | grep xclip alias c="xclip -selection c" alias v="xclip -selection c -o" ➜ ~ which dict | c ➜ ~ v /usr/bin/dict ➜ ~ sudo vim ?? …
roachsinai
  • 306
  • 4
  • 16
1
2