-
-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: copy selected process command to clipboard #496
base: main
Are you sure you want to change the base?
Conversation
c7c3557
to
113d510
Compare
Hmm I just realized that dacap/clip: Cross-platform C++ library to copy/paste clipboard content is X11 only. Is there some library perhaps that supports Wayland as well? |
9156e4a
to
6d43925
Compare
@stevenxxiu @porceCodes A button called And would avoid the mess of determining the current windowing system and adding external libraries on Linux. What do you guys think of this solution? It would certainly simplify things a bit. |
That would be good if copying can still be done with one key. But I'm not sure if terminal emulators support copying regions selected in other programs. I just tried selecting some region in the Micro text editor and using WezTerm's copying key, but that didn't copy anything. Turns out Micro uses some clipboard library itself. One goal for mine here is to do it quickly and more easily than the If I have to manually drag my mouse to copy the text, that just becomes a pain. |
6d43925
to
c0756c2
Compare
@stevenxxiu
My question here would be how many people have a need to regularly copy the command line of a running process, would just having the ability to see the full cmd be enough for most people and if need be manually select and copy it. Is there enough people that would use this that it warrants a single key click and the extra includes and more involved compile process that comes with it? If that is the case, another solution could be to add a config setting for |
Well I think your idea of showing the full command line would be quite useful. Just to get a peek, whether it'll be copied not. I'm not sure how you would implement it, nor am I too fluent in C++ so it would be great if you made that happen 👍. I think there are enough people who want to copy the command line, as there are already a few issues about it, and 2 PRs, including mine. Using a |
36d0886
to
b8bcc0a
Compare
I added a copy_command = "/usr/bin/xclip -selection clipboard" |
6a41af4
to
584647a
Compare
I think being able to see the full command, however long it is, is more useful than being copying-out that text. By doing so, we can separate out pending concerns from a primary usefulness. Please note however, the maximum length for a command line characters can be large enough not to fit within a single screen, and may require scrolling when visual selection is required. |
If the command is so long you have to scroll to see it, it'll probably be hard to tell what's in it. This is another case where copying it becomes very useful, to look at it in a text editor. |
b89549a
to
e678990
Compare
ddc5a31
to
7ceb2d5
Compare
7ceb2d5
to
d1c92b5
Compare
…opy to clipboard instead, to support all windowing systems
d1c92b5
to
48f6425
Compare
Any chance of taking a look at this again? I changed the default key to |
This is for [REQUEST] Include a method to copy process parameters · Issue #346 · aristocratos/btop.
Now when a process is selected, can press
X
to copy its command.I'm not too sure what key to use here, so thought of
X
as inCtrl + X
for cut. Most keys seem to be used up.I looked at macOS: Copy out the select process's command line by porceCodes · Pull Request #478 · aristocratos/btop for some inspiration. Incorporated some of the code, like extending the maximum command line length that's stored.
Took some of your comments into account:
selected_cmd
.Only tested on X11.