Skip to content
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

Enable Copy and pasting from the tui #267

Open
0xmovses opened this issue Oct 22, 2024 · 10 comments
Open

Enable Copy and pasting from the tui #267

0xmovses opened this issue Oct 22, 2024 · 10 comments
Labels
enhancement New feature or request need more info

Comments

@0xmovses
Copy link

Feature Request

It would be great to be able to copy and paste from the tui

Use Case:

To easily share output

Proposed Change:

Who Benefits From The Change(s)?

Developers

Alternative Approaches

@F1bonacc1
Copy link
Owner

Hi @0xmovses,

Are you using Wayland?
If yes, please check #116

I can probably solve it by requiring the users to install an additional dependency on their Wayland distro, which I wanted to avoid.

@F1bonacc1 F1bonacc1 added enhancement New feature or request need more info labels Oct 26, 2024
@joefiorini
Copy link

I'm on macOS using Kitty and am also unable to copy/paste from the tui log output. I can use select mode to select text but pressing cmd+c to copy does nothing. Is there a separate shortcut specific to process-compose or Kitty I should be using?

@adrian-gierakowski
Copy link
Contributor

Is there a separate shortcut specific to process-compose or Kitty I should be using?

Try Control + Shift + H and then select and copy

@F1bonacc1
Copy link
Owner

Hi @joefiorini,
I never personally tested it on macOS, but processs-compose should show you this hint when you enter selection more:
image

Can you please confirm:

  1. that the hint is indeed shown
  2. that when you press Enter the selection is indeed copied

Thanks!

@kaibr
Copy link

kaibr commented Nov 29, 2024

I'm on WSL using Windows Terminal and I have searched quite a while for a way to enter selection mode. Normally it's just clicking and dragging the mouse. I found that pressing Shift and dragging the mouse works. There is no hint shown that would indicate that process-compose is aware that it is now in selection mode.

When selecting multiple lines this way, the windows borders are also selected (and copy-pasted). It would be better to be able to just select the log text.

@F1bonacc1
Copy link
Owner

F1bonacc1 commented Nov 30, 2024

Hi @kaibr,

Did you go into selection mode with Ctrl+S?

@kaibr
Copy link

kaibr commented Nov 30, 2024

Actually, I'm not sure what "selection mode" is, whether that is a mode of the terminal or of process-compose, and whether either was in it. What I can say is that I was able to select, copy and paste text. In order to select text, I had to press Shift and drag the mouse. I did not press Ctrl-S at any point. Just now, I tested what pressing Ctrl-S does and it does not seem to do anything. In particular, it does not allow me to select text.

@F1bonacc1
Copy link
Owner

Your terminal may have bound Ctrl-s to some other shortcut.
You can try to change either your terminal or process-compose shortcut.
https://f1bonacc1.github.io/process-compose/tui/#shortcuts-configuration

# $XDG_CONFIG_HOME/process-compose/shortcuts.yaml
shortcuts:
  log_select: # action name - don't edit
    shortcut: Ctrl-S # shortcut to be used

You should see the change after restarting process-compose:
image

@kaibr
Copy link

kaibr commented Nov 30, 2024

My terminal does not seem to bind Ctrl-S (Windows Terminal default bindings). However, I tried your suggestion and bound log_select to Ctrl-R, Ctrl-T, Ctrl-U, F1, F11, F12. None of that worked. (In particular, there was no change in the visible key bindings on screen.) To see whether process-compose was actually finding shortcuts.yaml, I bound quit to F3 (as in the docs). Then the change was visible -- however: the key F3 did not actually quit, it showed process info just as before.
image

@F1bonacc1
Copy link
Owner

I tried F11 and it didn't work because it is bound to Full Screen in my Konsole (KDE Terminal), then I tried Ctrl-U and it worked as expected:
image

F3 behavior is expected since you must first unbind it from process_info to which it is bound by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request need more info
Projects
None yet
Development

No branches or pull requests

5 participants