Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
1
answers
39
views
Can Xfce's Clipman let you cycle the clipboard?
I use [Clipman - xfce4-clipman-plugin][1]. I sometimes copy two items and want to paste them both, one then the other. I would expect to be able to paste one (`ctrl` + `v`), press some keyboard combo to tell clipman to cycle back once, and then I expect to be able to paste (`ctrl` + `v`) again and g...
I use Clipman - xfce4-clipman-plugin . I sometimes copy two items and want to paste them both, one then the other. I would expect to be able to paste one (
ctrl
+ v
), press some keyboard combo to tell clipman to cycle back once, and then I expect to be able to paste (ctrl
+ v
) again and get the other item. Does Clipman support this?
I am aware of super
+ v
. That is not what I'm asking for. I want to effortlessly paste the previous item.
I have not found anything in the documentation to suggest that this is supported.
J. Mini
(117 rep)
Jul 23, 2025, 06:37 PM
• Last activity: Jul 27, 2025, 06:53 PM
2
votes
3
answers
1222
views
How can I navigate and copy some text from the past terminal output?
### Problem Very often when I work with `git` I need to copy some content from the output of the last command. And I hate switching from keyboard to trackpad/mouse. **Case #1** ``` ... ➜ extract_ttc git:(feature/simplify-gha-workflows) git push fatal: The current branch feature/simplify-gha-workflow...
### Problem
Very often when I work with
git
I need to copy some content from the output of the last command. And I hate switching from keyboard to trackpad/mouse.
**Case #1**
...
➜ extract_ttc git:(feature/simplify-gha-workflows) git push
fatal: The current branch feature/simplify-gha-workflows has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin feature/simplify-gha-workflows
I need to copy git push --set-upstream origin feature/simplify-gha-workflows
manually to execute, so I switching to mouse/trackpad from keyboard
**Case #2**
...
➜ extract_ttc git:(feature/simplify-gha-workflows) git push --set-upstream origin feature/simplify-gha-workflows
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 16 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 1.16 KiB | 1.16 MiB/s, done.
Total 6 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
remote:
remote: Create a pull request for 'feature/simplify-gha-workflows' on GitHub by visiting:
remote: https://github.com/fontist/extract_ttc/pull/new/feature/simplify-gha-workflows
remote:
To github.com:fontist/extract_ttc.git
* [new branch] feature/simplify-gha-workflows -> feature/simplify-gha-workflows
Branch 'feature/simplify-gha-workflows' set up to track remote branch 'feature/simplify-gha-workflows' from 'origin'.
I need to copy https://github.com/fontist/extract_ttc/pull/new/feature/simplify-gha-workflows
again to execute open
### Questions
- Is there a way to navigate the terminal output of the past commands (without mouse/trackpad)?
- Is there some approach that doesn't depend on the terminal app (for example I use iTerm on OSX)?
- If there is no solution in the way how I imagined it: what are possible approaches to achieve the same with keyboard only?
CAMOBAP
(270 rep)
Dec 21, 2020, 02:42 PM
• Last activity: Jul 16, 2025, 12:11 PM
11
votes
1
answers
3838
views
KVM clipboard sharing with client running Wayland
I have Fedora 35 installed as a VM, with `Qemu/KVM` as the hypervisor and `virt-manager` as the graphical front-end, running under Manjaro KDE. Following numerous guides & answers I have managed to get clipboard sharing to work between the host and client using the `spice` display server and `spice-...
I have Fedora 35 installed as a VM, with
Qemu/KVM
as the hypervisor and virt-manager
as the graphical front-end, running under Manjaro KDE.
Following numerous guides & answers I have managed to get clipboard sharing to work between the host and client using the spice
display server and spice-vdagent
on the client. However this only seems to work when the client logins to the X11 session. I have found [a Reddit post](https://www.reddit.com/r/swaywm/comments/pg0rqi/clipboard_sharing_using_spicevdagent_not_working/) which claims spice-vdagent
only supports the X11 clipboard, which is uncorroborated but so far agrees with my testing.
Here's the systemd journals when I login to X11/Wayland on the VM respectively:
> journalctl -b -u spice-vdagentd*
## timestamps & hostname removed
## X11
spice-vdagentd: opening vdagent virtio channel
spice-vdagentd: Set max clipboard: 104857600
spice-vdagentd: Set max clipboard: 104857600
## Wayland
spice-vdagentd: Error getting owner UID for pid 1063: No such process
spice-vdagentd: UID mismatch: UID=1000 PID=1063 suid=4294967295
So my question is: is it true that spice-vdagent
does not yet support Wayland clipboard? If false, what could be going wrong? If true, are there currently any good workarounds (except for the obvious "don't use Wayland")?
cyqsimon
(905 rep)
Apr 5, 2022, 02:26 PM
• Last activity: Jul 10, 2025, 09:49 PM
0
votes
0
answers
25
views
How to copy and paste from macOS host into VMWare virtual machine running ArchLinux and Hyprland?
I'm running ArchLinux in a virtual machine in VMWare. I've *open-vm-tools* installed but I'm unable to copy from macOS host and paste into Hyprland. How can I achieve this?
I'm running ArchLinux in a virtual machine in VMWare. I've *open-vm-tools* installed but I'm unable to copy from macOS host and paste into Hyprland. How can I achieve this?
Thesevs SCUTULATUS
(23 rep)
Jun 29, 2025, 06:27 PM
1
votes
1
answers
75
views
Recompiling Vim with +clipboard on Arch Linux (DWM/X11)
I use Arch Linux + DWM on the X Window System. I can't copy from Vim to an external application, and the `vim --version` command returns `-xterm_clipboard`. As I understand it, I need to recompile my Vim and add clipboard support into the config file, but I don't know where to find it. Is it the `~/...
I use Arch Linux + DWM on the X Window System. I can't copy from Vim to an external application, and the
vim --version
command returns -xterm_clipboard
. As I understand it, I need to recompile my Vim and add clipboard support into the config file, but I don't know where to find it. Is it the ~/.vimrc
file? I can't find the original PKGBUILD in my ~/vim/
directory either.
I've tried to use **pacbuilder-svn** and ran:
$ pacbuilder --install --edit vim vim-runtime
But the script doesn't ask me whether I want to edit the PKGBUILD file; it just builds the packages and that's it.
I've also tried to use **devtools** and ran:
$ sudo pkgctl repo clone https://github.com/vim/vim.git
But it says:
failed to clone https://github.com/vim/vim.git
How can I recompile my Vim with clipboard support? I would be grateful for your help.
Bernadette
(13 rep)
Jun 8, 2025, 06:33 AM
• Last activity: Jun 8, 2025, 07:53 AM
7
votes
2
answers
5746
views
tmux mouse scrolling without altering copy/paste?
I'm having difficulty finding an explanation for allowing the OS default copy/paste capabilities (i.e. highlight a portion of text and then use standard shortcut or right-click menu) and allow mouse scrolling at the same time. Mouse mode turns on tmux's own copy/paste system, but leaving it off remo...
I'm having difficulty finding an explanation for allowing the OS default copy/paste capabilities (i.e. highlight a portion of text and then use standard shortcut or right-click menu) and allow mouse scrolling at the same time. Mouse mode turns on tmux's own copy/paste system, but leaving it off removes the mouse scrolling. As I'm switching between an IDE, browser, and terminal with tmux I would like the controls to be consistent between all of them. Is there a way to have the standard OS copy/paste controls while also allowing the mouse to scroll in tmux?
_(Note: I originally asked, but deleted, this question on SO. I decided it was more appropriate here.)_
Jenny Shoars
(213 rep)
Sep 25, 2016, 08:05 PM
• Last activity: Jun 7, 2025, 02:49 PM
4
votes
2
answers
2017
views
How to use Ctrl+mouse click in tmux?
Due to the change in Tmux2.1, I need to remap my mouse's middle click to tmux's paste: bind -T root MouseDown2Pane run -b "tmux paste-buffer" However, I also would like to enable using Ctrl (or Alt , Cmd ) + middle click to paste the system's clipboard. This is what I have tried (failed) so far: bin...
Due to the change in Tmux2.1,
I need to remap my mouse's middle click to tmux's paste:
bind -T root MouseDown2Pane run -b "tmux paste-buffer"
However, I also would like to enable using Ctrl
(or Alt, Cmd) + middle click
to paste the system's clipboard.
This is what I have tried (failed) so far:
bind -T root M+MouseDown2Pane run -b "pbpaste | tmux load-buffer -; tmux paste-buffer"
dragonxlwang
(783 rep)
Nov 15, 2015, 07:46 PM
• Last activity: Jun 3, 2025, 03:03 AM
1
votes
1
answers
3403
views
Copy paste from unix file to notepad
How can I copy content of large unix file (putty tool) to notepad?
How can I copy content of large unix file (putty tool) to notepad?
Mohit Mathur
(11 rep)
Sep 20, 2018, 03:11 PM
• Last activity: Jun 1, 2025, 06:03 PM
58
votes
6
answers
75082
views
Copy selection to a clipboard in tmux
If I select text with a mouse in tmux in iTerm2 on macOS I get the selected text copied into my clipboard. I do not have to click any extra buttons - just select the text you want and you're done. I've tested tmux in terminal.app on macOS but it doesn't work there - I have to hit `y` to copy the sel...
If I select text with a mouse in tmux in iTerm2 on macOS I get the selected text copied into my clipboard. I do not have to click any extra buttons - just select the text you want and you're done.
I've tested tmux in terminal.app on macOS but it doesn't work there - I have to hit
y
to copy the selection to my clipboard.
I thought that there is a mouse binding (something like MouseOnSelection
similar to MouseDown1Pane
) but I couldn't find anything useful on the web and man tmux
.
I wonder if there is a way to have a similar behaviour on Ubuntu 16.10 - preferably in the Gnome terminal.
Mateusz Piotrowski
(4983 rep)
Mar 3, 2017, 01:33 PM
• Last activity: May 31, 2025, 06:19 PM
2
votes
1
answers
173
views
Ranger: yank name does not copy anything to clipboard
I am using: ``` ranger version: ranger-master Python version: 3.11.8 (main, Feb 12 2024, 14:50:05) [GCC 13.2.1 20230801] Locale: en_US.UTF-8 ``` When I invoke `yank name` using `yn`, nothing happens. I use Arch linux + wayland + sway. How can I fix this ? Thank you for help
I am using:
ranger version: ranger-master
Python version: 3.11.8 (main, Feb 12 2024, 14:50:05) [GCC 13.2.1 20230801]
Locale: en_US.UTF-8
When I invoke yank name
using yn
, nothing happens. I use Arch linux + wayland + sway. How can I fix this ?
Thank you for help
Jan Černý
(1723 rep)
Mar 17, 2024, 10:22 PM
• Last activity: May 8, 2025, 09:38 AM
1
votes
1
answers
1235
views
In WSL console, how do you read and write to the clipboard?
How do you access the (windows) clipboard in WSL so that you can pipe it into commands, use it as stdin, etc.? There's more than enough answers about how to *write* to the clipboard. But I couldn't find any specifically about *reading* from it. For what it's worth: I'm answering my own question. Hop...
How do you access the (windows) clipboard in WSL so that you can pipe it into commands, use it as stdin, etc.?
There's more than enough answers about how to *write* to the clipboard. But I couldn't find any specifically about *reading* from it.
For what it's worth: I'm answering my own question. Hopefully this saves others time in the future.
Daniel Kaplan
(1070 rep)
Mar 10, 2022, 09:14 AM
• Last activity: May 6, 2025, 05:14 PM
0
votes
0
answers
21
views
JMeter on my Sequoia - Clipboard does not work
I have installed JMeter version 5.6.3 on my Sequoia 15.2 Mac laptop. Everything works fine except the clipboard. I can't copy and paste anything into the JMeter GUI. It's running under JDK 17.
I have installed JMeter version 5.6.3 on my Sequoia 15.2 Mac laptop. Everything works fine except the clipboard. I can't copy and paste anything into the JMeter GUI. It's running under JDK 17.
Perugini
(1 rep)
May 3, 2025, 02:35 PM
• Last activity: May 3, 2025, 02:56 PM
1
votes
1
answers
2216
views
Copy & paste Python code into the command line
When I paste several lines at once in a Python3.9 session in the terminal in my Mac it does not understand that they are different lines, and it fails: ``` Python 3.9.1 (default, Jan 8 2021, 17:17:17) [Clang 12.0.0 (clang-1200.0.32.28)] on darwin Type "help", "copyright", "credits" or "license" for...
When I paste several lines at once in a Python3.9 session in the terminal in my Mac it does not understand that they are different lines, and it fails:
Python 3.9.1 (default, Jan 8 2021, 17:17:17)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 7
b = 3
a + b
File "", line 1
a = 7
b = 3
a + b
^
SyntaxError: multiple statements found while compiling a single statement
But the funny thing is that if I do it in a Python2.7 it goes well:
Python 2.7.16 (default, Jun 5 2020, 22:59:21)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 7
>>> b = 3
>>> a + b
10
I would think that there is something in my environment or bash_profile but why it fails only in the 3.9 version?
Thanks in advance.
Miguel.
miguelbadajoz
(111 rep)
Jan 26, 2021, 09:06 AM
• Last activity: Apr 28, 2025, 01:00 AM
0
votes
2
answers
453
views
Linux pastes clipboard at "random" times
I'll be editing files, actively using a keyboard and sometimes a mouse, especially to switch windows and such. My programs open under edit suddenly have syntax errors which, ultimately come from things pasted into from my clipboard into the editor. This happens in every normal editor, not so much Gv...
I'll be editing files, actively using a keyboard and sometimes a mouse, especially to switch windows and such. My programs open under edit suddenly have syntax errors which, ultimately come from things pasted into from my clipboard into the editor. This happens in every normal editor, not so much Gvim (mostly due to the unorthodox keyboard sequences).
My mouse has a scroll wheel.
The scroll wheel can be clicked like a button
It has 2 main left and right buttons
It also has 2 buttons on the left labeled + and -, both of which I almost never press. I rarely, if ever, press down on the scroll wheel but do scroll active windows with it.
What should I look for? This is an OTB Debian installation
$ set |grep DESKTOP
CHROME_DESKTOP=code-url-handler.desktop
DESKTOP_SESSION=mate
MATE_DESKTOP_SESSION_ID=this-is-deprecated
ORIGINAL_XDG_CURRENT_DESKTOP=MATE
XDG_CURRENT_DESKTOP=MATE
XDG_SESSION_DESKTOP=mate
$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.1 LTS"
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/ "
SUPPORT_URL="https://help.ubuntu.com/ "
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/ "
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy "
UBUNTU_CODENAME=jammy
Woodsman
(149 rep)
Nov 8, 2022, 04:20 PM
• Last activity: Mar 10, 2025, 05:05 PM
86
votes
12
answers
188342
views
Copy-paste for vim is not working when mouse (:set mouse=a) is on?
I was trying to copy paste something from vim to another application and also, from that application to `vim` using right click with mouse and then copy and paste (or with Ctrl + v and Ctrl + c and also tried the Command version for mac OSX, obviously.). However, when I try doing it, it only copies...
I was trying to copy paste something from vim to another application and also, from that application to
vim
using right click with mouse and then copy and paste (or with Ctrl+v and Ctrl+c and also tried the Command version for mac OSX, obviously.). However, when I try doing it, it only copies the first word when I do it from vim
or when I copy from the application to vim
, it copies everything, but inserts strange tabs and spaces. I think this happened when I decided to set my mouse on in the terminal. As in:
:set mouse=a
I have that line on my .vimrc
file on iTerm (mac os x). Though, is it possible to make my copy paste with other applications that are not in vim
not to break with the mouse=a
on? Or is it at least possible to set my mouse off while I do the copy paste? I did :help
mouse but the comments were not useful for me. I would paste them here but... my copy paste tool is broken!
I did try :set mouse!
and :set mouse=a!
but these did nothing useful... :(
----
Additional info of my environment:
I am also using tmux most of the time, though, I tested this error/bug without a tmux session, thats why I posted this mainly as a vim question.
Charlie Parker
(1597 rep)
Jun 27, 2014, 07:12 PM
• Last activity: Feb 19, 2025, 08:11 PM
0
votes
1
answers
48
views
Yanking to the global clip board from the command line in Vi editing-mode
I am using Arch, bash and gnome terminal. All are up to date with the very latest software versions. I wish to bind ctrl+c to yank the current line on the command line to the global clipboard, which may not yet be in the history file. So far I have had no success. Parsing the history file is problem...
I am using Arch, bash and gnome terminal.
All are up to date with the very latest software versions.
I wish to bind ctrl+c to yank the current line on the command line to the global clipboard, which may not yet be in the history file. So far I have had no success.
Parsing the history file is problematic becasue the line on the command line may be yanked before the command has been run, in which case it won't be in the history file, so parsing this is not a viable option.
.bashrc
has vi bindings enabled as follows
# set editing-mode vi
set -o vi
I am being careful to re-source each time as necessary with source ~/.bashrc
.
I have tried adding the below various options to .inputrc
, re-initialising each time with bind -f ~/.inputrc
, none have worked.
**.inputrc
tests:**
$if mode=vi
"\C-y": " \C-e\C-u\C-k\C-y\C-l\C-y\C-e\C-y\n"
$endif
and this
$if mode=vi
"\C-c": "\e0\C-k\C-u\C-y\n"
$endif
and these
"\"+y": yank-to-clipboard
"\Cc": copy-line # ctrl+c
"\^C": copy-line # ctrl+c
"\006": copy-line # ctrl+c
**.bashrc
tests:**
I have also tried adding the following to .bashrc
bind -m vi-command '"\C-y": "fc -ln -0 | tr -d \"\\n\" | xclip -selection clipboard\n"'
then
copy_current_command() {
local cmd
cmd=$(fc -ln -0)
echo -n "$cmd" | xclip -selection clipboard
}
bind -m vi-command '"\C-c": "copy_current_command\n"'
The below does not work either
This is .inputrc
"\e[1;6C": yank-to-clipboard # ctrl+shift+c
"\^C": yank-to-clipboard # ctrl+c
and this in .bashrc
yank-to-clipboard() {
local line=$(readline) # get the current line
echo "$line" | xclip -in -selection clipboard
}
Kes
(909 rep)
Feb 2, 2025, 01:47 PM
• Last activity: Feb 3, 2025, 12:29 AM
14
votes
2
answers
41526
views
QEMU/KVM Windows 10 Guest won't copy/paste text or files back to host
I am running Debian 9 (Stretch) with QEMU/KVM hosting a Windows 10 - 1809 guest. Using Spice for graphics. I installed SPICE Guest Tools 0.141 and am able to copy/paste files and text from my Debian host to my Windows guest. However, I am unable to copy from the Windows guest to the host. I have tri...
I am running Debian 9 (Stretch) with QEMU/KVM hosting a Windows 10 - 1809 guest. Using Spice for graphics.
I installed SPICE Guest Tools 0.141 and am able to copy/paste files and text from my Debian host to my Windows guest. However, I am unable to copy from the Windows guest to the host.
I have tried reinstalling Spice Tools on the guest. I have checked that the Channel spice has been added and it looks good to my untrained eye. I checked the guest log files for errors, with no luck.
Austin Baccus
(143 rep)
Feb 13, 2019, 06:55 PM
• Last activity: Jan 26, 2025, 11:46 PM
11
votes
3
answers
4905
views
make terminal selection automatically copy to the system clipboard buffer?
Is there a way to have terminal applications (gnome-terminal, terminator, etc) automatically move selected text to the CLIPBOARD system buffer, and not just the PRIMARY (i.e. terminal-local) buffer? I found this which describes the primitives, but not to the extent that I could make the behavior cha...
Is there a way to have terminal applications (gnome-terminal, terminator, etc) automatically move selected text to the CLIPBOARD system buffer, and not just the PRIMARY (i.e. terminal-local) buffer?
I found this which describes the primitives, but not to the extent that I could make the behavior change: primary / clipboard intro ...
I've got a specific hosted VM use case where I'm very frequently copying text from a bash or vim session in the linux guest back to the windows host... and after 20 years of linux I'm so used to the buffer "just being there" that I'm trying to replicate that behavior...
ljwobker
(559 rep)
Dec 8, 2014, 04:28 AM
• Last activity: Jan 15, 2025, 10:56 PM
12
votes
3
answers
10675
views
Copy text from remote tmux to local x clipboard
I ssh into my VPS and run tmux. I can copy/paste from the remote to local, and local to remote - using the mouse and shift. But I don't know how to copy *large quantities of text*. If I were working locally, I could do this: `cat somefile.txt | xsel -b` or `cat somefile | xclip -selection clipboard`...
I ssh into my VPS and run tmux. I can copy/paste from the remote to local, and local to remote - using the mouse and shift.
But I don't know how to copy *large quantities of text*.
If I were working locally, I could do this:
cat somefile.txt | xsel -b
or cat somefile | xclip -selection clipboard
to copy into the clipboard. (I can't do that of course as the remote server doesn't run x, and even so the clipboard would not match the one used in tmux.)
So, how do I copy text in the tmux session, and for it to be duplicated over the wire to my local system's clipboard?
UPDATE:
Actually, this is applicable even without tmux - how to copy-paste large buffers between a remote and local shell.
lonix
(1965 rep)
Mar 14, 2020, 11:26 AM
• Last activity: Dec 25, 2024, 08:02 PM
3
votes
0
answers
111
views
Run a script when Clipboard is changed
I know that the clipboard is not a function of the Linux kernel but a feature of the desktop. And there is no "location" where the content in the clipboard is saved. Clipboard is saved in RAM. Is there a way to run a script every time the clipboard is changed? The only way I know is to run a infinit...
I know that the clipboard is not a function of the Linux kernel but a feature of the desktop. And there is no "location" where the content in the clipboard is saved. Clipboard is saved in RAM.
Is there a way to run a script every time the clipboard is changed? The only way I know is to run a infinite loop, something like this:
while true; do
var1=$(xclip -selection clipboard -o)
sleep 0.5
var2=$(xclip -selection clipboard -o)
if [ "$var1" != "$var2" ]; then
make crazy sh*t
fi
done
Is this the only way?
fmeier
(361 rep)
Nov 19, 2024, 04:50 PM
• Last activity: Nov 20, 2024, 10:18 AM
Showing page 1 of 20 total questions