-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zsh: cd into folder name including brackets fails to match a supposed pattern #595
Comments
I confirm that this looks like a zsh specific problem:
|
I'm not sure what the generated outcmd looks like. Is it generated specifically depending on the shell, or is the same outcmd used regardless of shell? And I really don't know how the filename gets formatted/inserted... If it's shell-aware, for zsh it might be a good idea to:
|
The function used for zsh is defined here: https://github.com/Canop/broot/blob/master/src/shell_install/bash.rs#L31 If you're willing to investigate and try a better general solution, go ahead, I'm a little too busy atm. |
Thanks, I'll look around. But I'm not so much wondering about the EDIT: found EDIT: even more relevant: |
Can you replace the Zsh-specific $ mkdir '[nopat]'
$ cd [nopat]
zsh: no matches found: [nopat]
$ noglob cd [nopat]
$ pwd
/home/andy/[nopat] If broot's |
@AndydeCleyre Would that entry in verbs.hjson solve the problem for zsh users ?
|
That verb works, yes. But I don't use a shortcut and rely on typing
But reviewing the docs and this conversation, it seems I can replace that with:
And it all seems to work. Thanks! |
Now the question is how to make this verb discoverable by zsh users...
|
This problem can now ( {
key: alt-enter
invocation: cd
cmd: ":write_output {directory};:quit"
} with the following launcher function (Zsh): zmodload zsh/mapfile
# -- Run broot, cd into pathfile if successful --
# Depends: zmapfile
br () { # [<broot-opt>...]
emulate -L zsh
local pathfile=$(mktemp)
trap "rm ${(q-)pathfile}" EXIT INT QUIT
if { broot --verb-output "$pathfile" $@ } {
if [[ -r $pathfile ]] {
local folder=${mapfile[$pathfile]}
if [[ $folder ]] cd $folder
}
} else {
return
}
} |
In broot, use verb
cd
on the folder named[notapattern]
The text was updated successfully, but these errors were encountered: