Using tmux
to run commands in a separate window
#1700
Replies: 2 comments 5 replies
-
I try this code, but doesnt work. Exactly nothing happend when press w, t or L. I'm on Debain 12 stable with dk tiling windows manager and st terminal. |
Beta Was this translation helpful? Give feedback.
-
I find the solution, but this method doesnt solve many problems, and for this I also need to run tmux before running lf. Then, in addition, tmux visually messes up the bottom row with its own information bar, so this is not good, at least for me. It would be more useful if the output could be sent there in the % version, for example sudo could ask for the password there. Of course, the most perfect thing would be if a separate small window came up and you could type in there, as we say in the case of yazi program. But if this cannot be realized, then this will remain an eternal shortcoming of the lf. |
Beta Was this translation helpful? Give feedback.
-
There are various modes for running custom shell commands, but each of them have certain limitations:
shell-async
commands (&
) run in the background and does not allow for user input/output.shell
commands ($
) allows for user input/output, but also suspends the UI so that it is not visible.shell-pipe
commands (%
) is an attempt to combine the benefits of theshell-async
andshell
commands, but can only display a single line of output, and additionally input is line-buffered so text cannot be sent without pressing Enter.One way to solve this problem is to enhance
lf
so that it can run commands inside a separate window in the UI. But I think this is not trivial to implement for a few reasons:tcell
library is fairly low-level and does not have the concept of creating UI widgets.pty
.Because of this, I do not see this kind of feature being supported natively in
lf
in the near foreseeable future. Such a feature may also stray from the design goal of keepinglf
as a minimalistic application, which involves integration with other tools to support features instead of trying to implement everything by itself.However, I recently had the idea of using
tmux
to create a separate 'drawer' panel on the bottom, which can serve various purposes, such as running a shell or displaying various information. Below is a sample configuration, which creates a utility commandopen-drawer
to run various commands inside a separate window:I am not completely sure how useful this kind of technique is in practice, but hopefully other people will find ways to utilize this for their own needs.
Beta Was this translation helpful? Give feedback.
All reactions