davidshepherd7 / terminal-here

An Emacs package to open an external terminal emulator in the current directory
GNU General Public License v3.0
73 stars 12 forks source link

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

Open srustamo opened 4 years ago

srustamo commented 4 years ago

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?

davidshepherd7 commented 4 years ago

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?

srustamo commented 4 years ago

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

QiangF commented 3 years ago

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 commented 3 years ago

Guake is linux only though.

QiangF commented 3 years ago

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))