lf
lf copied to clipboard
Instantiate a shell
$ will allow you to run a shell command and the output goes somewhere (idk). Is there a way to make $ open a full shell sub-process (prompt) in the preview window at the current directory? This way all of the output is visible and you get a full log of all the commands your previously ran. Of course, you could run exit to close the shell, but it'd be additionally convenient if you could "hide" the shell somehow so you can get back to it later with $.
I don't see why you would ever have to leave lf with the ability to: navigate around the file system, pop into the active shell, run some commands, pop out of the shell, move to another directory, pop back into the shell (in the active directory), run some new commands, etc.
The default binding for launching a shell is w, see the documentation. Of yourse you can change the binding to whatever you prefer.
The output of the shell should redraw whenever you exit the shell and start a new one from lf (perhaps this depends on your terminal capabilities), so there should be no need to "hide" an active shell.
Is there a way to have the shell open in the third (right-most) window; where the file previews are shown?
No, you can't open the shell "within" the lf window/screen – that's a non-feature. You can use tmux to split the terminal whatever you like.
The issue with using something like tmux is that it doesn't manage the lf screens. I'm interested in managing the behavior of the three windows/screens.
If you have a lf binding for splitting the current tmux window, you can combine it with toggling the preview option.
Interesting. Can you toggle lf to only show one narrow screen of the current directory? This way I can bind many lf commands to open a new tmux window on the right with a 3/4th screen width (or similar) for not only an interactive shell, but also for showing editors which may be cool too. How do I change the view mode for lf (show only current directory) and then how do I send the correct tmux commands to split the window?
You can try something like :set ratios 1:1:1000 or 1:1000:1, but unfortunately that depends on whether you have preview on or off. I don't think lf has an option to set the number of panes to 2 or 1. As for tmux, you can find some examples here and in other sections on that page.
Sorry for my bumping, but is there way to inherit shell options for $ - it doesn't follow neither aliases nor env variables, sadly