help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to change the default-directory when using aliases in shell-mode


From: Rodrigo Morales
Subject: How to change the default-directory when using aliases in shell-mode
Date: Tue, 22 Jun 2021 22:38:56 -0500

I'm using ZSH and I've defined the following alias in my configuration
file (i.e. =.zshrc=)

#+BEGIN_SRC zsh
alias d="cd ~/Downloads"
#+END_SRC

The problem is that when I use that alias in buffers whose major mode is
shell-mode, the value of default-directory is not changed. For this
reason, I'm wondering how to make the default-directory be the same as
the shell current working directory when an alias has been used.

I think this would be solved if I stopped using aliases, but then I
would need a way for switching between directories easily in shell-mode
buffers. I'm mentioning this in order to avoid the XY problem. My goal
here is to visit commonly visited directories on the fly while being in
shell-mode buffers.

Greetings,
Rodrigo Morales

---
rdrg109 on Libera Chat



reply via email to

[Prev in Thread] Current Thread [Next in Thread]