extraterm icon indicating copy to clipboard operation
extraterm copied to clipboard

[Feature request] Instead of "open terminal window here", possible to open file browser automatically to the directory in which you are currently in the terminal?

Open MostHated opened this issue 5 years ago • 3 comments

Hey there,
I am not even sure if this is possible, but there have been numerous occasions in which it would be pretty nice to be able to open the file explorer directly to the location in which I am currently in my terminal. Is this something that can be done? (Perfectly fine if it requires the plugin/extraterm commands installed). Either an actual terminal command, right click menu item, or from the command pallet?

Thanks, -MH

MostHated avatar Jun 24 '19 17:06 MostHated

This is the kind of thing I want the plugin API to be powerful enough to support. This is a good feature suggestion too.

sedwards2009 avatar Jun 25 '19 16:06 sedwards2009

@MostHated - I'd love to see it implemented as well. And it's good to see that there's a medium priority for this issue. In the meanwhile you could add something like this to your .zshrc (assuming you use zsh):

precmd() { eval "$PROMPT_COMMAND" }
PROMPT_COMMAND='pwd > "${HOME}/.cwd"'
[[ -f "${HOME}/.cwd" ]] && cd "$(< ${HOME}/.cwd)"

After every command it saves the current working directory in a file and whenever you open a new tab, the emulator will fetch the path from this file. It's a little hacky, but I feel like it's a decent workaround until we get native support :)

itsameandrea avatar Jul 22 '19 12:07 itsameandrea

@MostHated I use xdg-open for this on Linux-esque systems. (On macOS, just use open .)

To install if not already installed:

sudo apt install xdg-utils

In my .zshrc, I have the following alias:

alias open='xdg-open'

And so I just do open ., same as on macOS. (I don’t entirely remember but I think you can do the same thing on Windows by running explorer.exe).

Not exactly what you asked for but hope it helps in the interim :)

aral avatar Oct 20 '20 09:10 aral