joshuto
joshuto copied to clipboard
Is there an Option for 'leaving/quit joshuto on current directory'?
First, I want to say: I really like joshuto and appreciate the work done by this project.
The default behavior - if you leave/quit joshuto - is, that you are in the directory, where you started the joshuto session.
[In ranger this behavior is the default behavior if you start the session with ranger
]
Is there an option to set, that you can leave/quit joshuto on the current directory, that you are in?
[In ranger you can force this behavior by starting ranger with . ranger
]
I really like the behavior and find it much more convenient than the default one ( 1. you maybe don't remember after hours, in which directory you did start the joshuto-session 2. If you are in a session, you can quickly go to terminal (and do some stuff there) and go back to joshuto).
Yep, there is a bash script you can find here: https://github.com/kamiyaa/joshuto/blob/main/docs/configuration/keymap.toml.md#general
that allows you to exit to current directory
Yep, there is a bash script you can find here: https://github.com/kamiyaa/joshuto/blob/main/docs/configuration/keymap.toml.md#general
that allows you to exit to current directory
Thanks! It works fine except if we use close_tab and there's a single tab present.
Can you give example of how to use this script? I added it to my .bashrc, but opening joshuto and navigating to another folder doesn't seem to help. When I quite joshuto it just goes back to the original folder where I opened it.
Ah seems like quitting with Q should work as it created temp folder, but instead I am getting Exit code: 101, is there a way to make this more verbose?
I've add more documentation on how quit
works and the exit codes of each one here: https://github.com/kamiyaa/joshuto/blob/main/docs/configuration/keymap.toml.md#quit-quit-joshuto
lmk if it helps!
Maybe this helps others like me who come from ranger and don't like reading docs.
To make a fresh installation of joshuto always exit to the current directory, do this:
-
Make an alias in your .bashrc or .zshrc:
alias joshuto='joshuto --output-file /tmp/joshutodir; LASTDIR=`cat /tmp/joshutodir`; cd "$LASTDIR"'
-
Make sure you copied the
.toml
files fromconfig
(in this repo) to$HOME/.config/joshuto
. -
Edit
$HOME/.config/joshuto/keymap.toml
and find{ keys = [ "q" ], command = "close_tab" }, { keys = [ "Q" ], command = "quit --output-current-directory" },
and change it to
{ keys = [ "Q" ], command = "close_tab" }, { keys = [ "q" ], command = "quit --output-current-directory" },
-
(optional) Initially, I get a a lot of warnings from joshuto, so I removed every line with
escape
,numbered_command
,symlink_files
,toggle_visual
,linemode
from$HOME/.config/joshuto/keymap.toml
.
Then joshuto will exit to the current directory by pressing q
.
Probably there is better way but as a user I am just looking for snippet I can copy to my config.