terminal-here icon indicating copy to clipboard operation
terminal-here copied to clipboard

Re-using existing Windows Terminal when one is already open at cwd

Open srustamo opened this issue 5 years ago • 5 comments

I'm trying to figure out if it is possible to re-use an already open Windows Terminal window if one is already open at the cwd.

Any ideas how to go about it?

srustamo avatar Aug 10 '20 11:08 srustamo

You might be able to try something based on recording the PID (I assume windows has those) every time you create a new terminal, and only open a new one if the old one has finished?

davidshepherd7 avatar Aug 10 '20 16:08 davidshepherd7

If you can, please leave this open for a while, perhaps someone might chime in.

srustamo avatar Aug 11 '20 09:08 srustamo

You definitely need a way to talk with the terminal. Guake is a dropdown terminal that can be queried with dbus, see https://github.com/SleepyBag/dropdown-remote

QiangF avatar Oct 20 '20 07:10 QiangF

Guake is linux only though.

QiangF avatar Oct 20 '20 07:10 QiangF

I can reuse guake tab with this :

(use-package terminal-here
:config
(defun my-terminal-here-terminal-command (dir)
    (list "guake" "-s" "0" "--show" "-e"
        (concat "cd \"" (shell-quote-argument dir) "\"")))
(setq terminal-here-terminal-command 'my-terminal-here-terminal-command))

QiangF avatar Oct 20 '20 07:10 QiangF