mgunyho / tere

Terminal file explorer
European Union Public License 1.2
1.67k stars 36 forks source link

Quitting `tere` via `Escape` doesn't change the directory you started from. #34

Closed vpatov closed 2 years ago

vpatov commented 2 years ago

I am using tere inside of an Ubuntu 20.04.4 VM, which I ssh to from a macOS Monterey MacBookPro 2021 M1 Pro host.

My host and VM shell are both zsh version 5.8.

If I start using tere from a directory, then navigate to an arbitrary subdirectory using tere, I can't find a way to actually stay in that directory after exiting tere. I have tried both Escape and Ctrl+c, and unfortunately couldn't figure out a way to use Alt+Q because my Mac host does not have an Alt key.

Here's a video demonstrating the problem:

https://user-images.githubusercontent.com/8888572/179271204-4f46bfe3-63cd-4908-95ff-380586690e07.mov

mgunyho commented 2 years ago

Did you configure your shell init script as instructed in the setup guide? tere needs to be aliased, because a program cannot change the working directory of the parent shell that launched it.

Side note: based on your video, looks like there is some rendering issue, tere should show all folders, not just the one that is highlighted. Maybe this is an issue with the Mac build? Or could it be because of your colorscheme? If it's not the colorscheme, you can open a separate issue about that, although I don't know if I can help much because I don't have access to a Mac.

Barbacoa08 commented 2 years ago

I'm on a Mac (running MacOS), but I ran into this same issue and @mgunyho was correct. I had forgotten to update my .zshrc file and restart my shell 🤦 . Someday I'll learn to RTFM.

Full steps for my install (in case it's useful to anyone else):

  1. install rust: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. install tere via rust: cargo install tere
    • copy uri to tere (eg, /Users/myaccount/.cargo/bin/tere)
  3. in ~/.zshrc, add:
    tere() {
    local result=$(/Users/myaccount/.cargo/bin/tere "$@")
    [ -n "$result" ] && cd -- "$result"
    }
  4. restart shell
vpatov commented 2 years ago

@Barbacoa08 yup, that did the trick for me too. Sorry for adding noise by making an issue too quickly, I should also learn to RTFM.