Closed s3igo closed 1 month ago
If the goal is to quickly be able to access the shell then for those who want such a feature you may just set some keymaps to spawn a shell. To exit you simply exit the shell as always (exit
or ctrl+d).
Here is the config I use:
[default_view]
keymap = [
{ keys = ["s"], commands = [":shell "] },
{ keys = ["S"], commands = ["shell bash"] },
{ keys = ["'"], commands = ["shell bash"] },
]
I agree that in many use cases, using :shell
bash is sufficient. However, this approach has the drawback of potentially causing shell processes to nest deeper and deeper if not handled carefully, which is why I still believe this feature is valuable.
Additionally, for those who prefer a workflow where multiple background jobs, such as Vim instances, are kept running and managed using $ jobs
to list them and $ fg %n
to bring specific jobs to the foreground, it would be more convenient to have the ability to suspend processes with ctrl-z.
I can look into this to allow a command to suspend joshuto :+1:
Added suspend
command support in af643dba97acbc16af603450a35bafa9b1dd9da0
which is mapped to ctrl+z
by default.
There are some caveats here:
kill -s SIGTSTP $(pidof joshuto)
, it will cause the terminal to be all messed up. In the future, we can look into a global handler for these signals but it would probably require the handler to somehow reach into AppState
and modify itfunction joshuto() {
to allow you to exit to a specific directory. Once it suspends, this function will end and it won't try to cd
to a directoryThank you for the implementation! It's working smoothly.
In editors like Vim or TUI file managers like ranger, pressing ctrl+z sends a
SIGTSTP
signal to suspend the process, which can then be resumed with$ fg
. It would be very useful if joshuto had this feature as well.