process-compose
process-compose copied to clipboard
Enable Copy and pasting from the tui
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
Hi @0xmovses,
Are you using Wayland? If yes, please check https://github.com/F1bonacc1/process-compose/issues/116
I can probably solve it by requiring the users to install an additional dependency on their Wayland distro, which I wanted to avoid.
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?
Is there a separate shortcut specific to process-compose or Kitty I should be using?
Try Control + Shift + H and then select and copy
Hi @joefiorini,
I never personally tested it on macOS, but processs-compose should show you this hint when you enter selection more:
Can you please confirm:
- that the hint is indeed shown
- that when you press
Enterthe selection is indeed copied
Thanks!
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.
Hi @kaibr,
Did you go into selection mode with Ctrl+S?
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.
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:
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.
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:
F3 behavior is expected since you must first unbind it from process_info to which it is bound by default.
I can probably solve it by requiring the users to install an additional dependency on their Wayland distro, which I wanted to avoid.
I would love that solution, and hopefully enabling copying on wayland. Honestly such a great tool that is currently pretty limiting to anyone with that WM.
Hi @joefiorini, I never personally tested it on macOS, but processs-compose should show you this hint when you enter selection more:
Can you please confirm:
- that the hint is indeed shown
- that when you press
Enterthe selection is indeed copiedThanks!
I just tried this and got a go panic. I'm SSHed from my mac into a arch machine. My terminal is ghostty and the shell on the server is zsh.
goroutine 82 [running]:
github.com/rivo/tview.(*Application).Run.func1()
github.com/rivo/[email protected]/application.go:319 +0x45
panic({0x1112440?, 0xc001388130?})
runtime/panic.go:783 +0x132
github.com/f1bonacc1/glippy.start()
github.com/f1bonacc1/[email protected]/glippy_linux.go:30 +0x33f
github.com/f1bonacc1/glippy.startOnce.func1()
github.com/f1bonacc1/[email protected]/glippy.go:15 +0xf
sync.(*Once).doSlow(0xc0010f2380?, 0x1ad?)
sync/once.go:78 +0xac
sync.(*Once).Do(...)
sync/once.go:69
github.com/f1bonacc1/glippy.startOnce()
github.com/f1bonacc1/[email protected]/glippy.go:14 +0x2c
github.com/f1bonacc1/glippy.Set({0xc0010f2380, 0x1ad})
github.com/f1bonacc1/[email protected]/glippy.go:21 +0x1d
github.com/f1bonacc1/process-compose/src/tui.newPcView.(*pcView).createLogSelectionTextArea.func1(0xc001153d30?)
github.com/f1bonacc1/process-compose/src/tui/log-operations.go:104 +0x65
github.com/rivo/tview.(*TextArea).InputHandler.(*Box).WrapInputHandler.func2(0xc0003eb508?, 0xc001388100)
github.com/rivo/[email protected]/box.go:164 +0x37
github.com/rivo/tview.(*Grid).InputHandler.func1(0xc0004220e0, 0xc001388100)
github.com/rivo/[email protected]/grid.go:664 +0x1af
github.com/rivo/tview.(*Grid).InputHandler.(*Box).WrapInputHandler.func2(0xc000139290?, 0xc001388100?)
github.com/rivo/[email protected]/box.go:167 +0x50
github.com/rivo/tview.(*Pages).InputHandler.func1(0xc0004220e0, 0xc001388100)
github.com/rivo/[email protected]/pages.go:334 +0xa2
github.com/rivo/tview.(*Pages).InputHandler.(*Box).WrapInputHandler.func2(0xc0001bf3b0?, 0xc001153e28?)
github.com/rivo/[email protected]/box.go:167 +0x50
github.com/rivo/tview.(*Application).Run(0xc0004f84b0)
github.com/rivo/[email protected]/application.go:441 +0x8da
github.com/f1bonacc1/process-compose/src/tui.RunTUIAsync.func1()
github.com/f1bonacc1/process-compose/src/tui/view.go:604 +0x25
created by github.com/f1bonacc1/process-compose/src/tui.RunTUIAsync in goroutine 1
github.com/f1bonacc1/process-compose/src/tui/view.go:603 +0x31
same issue, inside tmux
Hi @joefiorini, I never personally tested it on macOS, but processs-compose should show you this hint when you enter selection more:
Can you please confirm:
- that the hint is indeed shown
- that when you press
Enterthe selection is indeed copiedThanks!
I just tried this and got a go panic. I'm SSHed from my mac into a arch machine. My terminal is ghostty and the shell on the server is zsh.
goroutine 82 [running]: github.com/rivo/tview.(*Application).Run.func1() github.com/rivo/[email protected]/application.go:319 +0x45 panic({0x1112440?, 0xc001388130?}) runtime/panic.go:783 +0x132 github.com/f1bonacc1/glippy.start() github.com/f1bonacc1/[email protected]/glippy_linux.go:30 +0x33f github.com/f1bonacc1/glippy.startOnce.func1() github.com/f1bonacc1/[email protected]/glippy.go:15 +0xf sync.(*Once).doSlow(0xc0010f2380?, 0x1ad?) sync/once.go:78 +0xac sync.(*Once).Do(...) sync/once.go:69 github.com/f1bonacc1/glippy.startOnce() github.com/f1bonacc1/[email protected]/glippy.go:14 +0x2c github.com/f1bonacc1/glippy.Set({0xc0010f2380, 0x1ad}) github.com/f1bonacc1/[email protected]/glippy.go:21 +0x1d github.com/f1bonacc1/process-compose/src/tui.newPcView.(*pcView).createLogSelectionTextArea.func1(0xc001153d30?) github.com/f1bonacc1/process-compose/src/tui/log-operations.go:104 +0x65 github.com/rivo/tview.(*TextArea).InputHandler.(*Box).WrapInputHandler.func2(0xc0003eb508?, 0xc001388100) github.com/rivo/[email protected]/box.go:164 +0x37 github.com/rivo/tview.(*Grid).InputHandler.func1(0xc0004220e0, 0xc001388100) github.com/rivo/[email protected]/grid.go:664 +0x1af github.com/rivo/tview.(*Grid).InputHandler.(*Box).WrapInputHandler.func2(0xc000139290?, 0xc001388100?) github.com/rivo/[email protected]/box.go:167 +0x50 github.com/rivo/tview.(*Pages).InputHandler.func1(0xc0004220e0, 0xc001388100) github.com/rivo/[email protected]/pages.go:334 +0xa2 github.com/rivo/tview.(*Pages).InputHandler.(*Box).WrapInputHandler.func2(0xc0001bf3b0?, 0xc001153e28?) github.com/rivo/[email protected]/box.go:167 +0x50 github.com/rivo/tview.(*Application).Run(0xc0004f84b0) github.com/rivo/[email protected]/application.go:441 +0x8da github.com/f1bonacc1/process-compose/src/tui.RunTUIAsync.func1() github.com/f1bonacc1/process-compose/src/tui/view.go:604 +0x25 created by github.com/f1bonacc1/process-compose/src/tui.RunTUIAsync in goroutine 1 github.com/f1bonacc1/process-compose/src/tui/view.go:603 +0x31