We changed our privacy policy. Read more.

Questions tagged [xsel]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
31 views

Shift+Insert on terminal copies from clipboard, not primary

Up until recently whenever I pressed Shift+Insert on my Linux terminal (whether Bash or Fish) it pasted my terminal selection ("primary"). Now all of a sudden it started pasting from my ...
0
votes
1answer
95 views

How do I copy a file to the clipboard with the terminal?

I'm aware of how to copy the contents of file: xsel -b < myfile.txt But this is not what I want. I would like something like this: ./file2clip.sh myfile.txt Which would copy myfile.txt to the ...
0
votes
1answer
44 views

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 ...
1
vote
1answer
124 views

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 ...
1
vote
1answer
301 views

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 ...
0
votes
1answer
53 views

Yank trimmed string in tmux copy mode

I am trying to yank string without trailing and heading spaces using this keybinding: bind-key -T copy-mode-vi z send-keys -X \ copy-pipe 'sed "s/^[[:blank:]]\+//;s/[[:blank:]]\+$//" | xsel -ib' ...
5
votes
1answer
7k views

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 ...
1
vote
0answers
337 views

Copy large texts to clipboard in X11

If I try to copy a large file (around 30K) to clipboard with xsel (or xclip), the copy operation fails and the content of clipboard remains unchanged. If it's a hard limit in X11, is there any way to ...
1
vote
1answer
123 views

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 ➜ ~ ...
16
votes
2answers
5k views

`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 ...
3
votes
1answer
120 views

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.
7
votes
2answers
882 views

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 -...
8
votes
0answers
953 views

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 ...
-3
votes
1answer
1k views

Do xsel and xclip work only for copy and not for paste?

The usages of xsel and xclip seem to me all about the copy operation, whether it is primary or clipboard selection. When I perform the paste operation, is it only by using mouse or trackpad, not via ...
4
votes
1answer
273 views

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 ...
1
vote
2answers
248 views

Can I pipe clipboard content to browser for viewing?

Here is the situation. I often have to read chunks of information from large plain text files. I am planning to use Readability extension for formating the content to make it readable on screen.
4
votes
3answers
3k views

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 ...
3
votes
0answers
124 views

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 ...