You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function open_dirs {
export -f open_dirs
row=""
row=$(exa -1 -l --no-permissions --no-user --no-filesize --no-time --all $PWD | fzf --header="pwd: $(pwd)" --preview 'v {}' --bind='ctrl-b:execute:(pkill fzf; cd "$PWD/.."; open_dirs)')
if [[ -n "$row" ]]; then
if [ -d "$row" ]; then
cd $row
open_dirs
elif [ -f "$row" ]; then
open_files "$row"
fi
fi
}
when I call this function, I can use Ctrl-B to go back to the upper directory. but the problem is that when I press ESC to exit fzf and come back to the terminal, PWD didn't change.
Seems ctrl-b:execute: part just changes the directory in the subshell.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have this function in my
.bashrc:when I call this function, I can use
Ctrl-Bto go back to the upper directory. but the problem is that when I pressESCto exit fzf and come back to the terminal,PWDdidn't change.Seems
ctrl-b:execute:part just changes the directory in the subshell.Any idea to solve this issue?
Beta Was this translation helpful? Give feedback.
All reactions