Open
Conversation
The default mode of the kitty terminal is to wait until output from all subprocesses is finished before closing. This means running `wl-copy asdf; exit` will exit the shell but cause kitty to hang as it waits for wl-copy to output. This change closes stderr to prevent this issue.
Owner
|
Hi! This has been proposed before (see #110), and I'm still not convinced this is a good idea. |
|
Use echo asdf | kitty +kitten clipboard instead, when running inside kitty. There is no need to use WM specific tools for copying to clipboard. |
|
Not closing stderr will leave a ssh command having called wl-copy to hang there until something else has copied. Also, doing a |
landonb
added a commit
to landonb/home-fries
that referenced
this pull request
Nov 16, 2025
- The wl-copy command hangs when run over SSH, unless SSH'd
to the same host as the desktop manager (even if you SSH
to a remote host, and then SSH back to your original host).
- This is a known issue:
bugaevc/wl-clipboard#154
- I also fixed some syntax errors in the elif conditionals.
- Specifically, unquoted -n tests are always true! e.g.,
[ -n ${undefined_variable} ]
is always true.
- (Oof! How embarrassing)
(,,>﹏<,,)
- So the wl-copy elif's were always running on GNOME Shell,
regardless of $WAYLAND_DISPLAY being declared or not.
- But now this is fixed, and I've added an additional elif
to check if the SSH session is connected to the originating
desktop host or not, so we can avoid hanging because of
the wl-copy issue referenced above.
- Finally, the clipboard copy pipeline will now warn-tell if the
clipboard is inaccessible... Although I may revert this change
soon. But I'd like to demo it for now. (Homefries defines some
helpful copy pipeline commands like `pp` to print and copy the
`pwd`; and DepoXy also defines some helpful copy pipeline cmds,
like `fdp` to print and copy the result from the `fd` cmd, and
`stp` to print/copy output from the `git status` command, etc.
And while I don't think I normally run these commands over SSH,
I'm not certain, so I don't expect to see the new warn message
very often. Or maybe I'm wrong & I will; I guess I'll FA & FO.)
How about my-copy() {
command wl-copy "$@" 2>/dev/null
}defined somewhere in your config. Then use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default mode of the kitty terminal is to wait until output from all subprocesses is finished before closing. This means running
wl-copy asdf; exitwill exit the shell but cause kitty to hang as it waits for wl-copy to output. This change closes stderr to prevent this issue.