When i use M-x shell to open a new terminal, it will sometimes set the current directory to the file in. But sometimes it won't. So is there a function to always open a new terminal in current directory?
Simply type in wt in the address bar and it will open the command prompt with the path to your current folder already set.
To see the current directory you're in in the Terminal, type pwd , which stands for “print working directory”.
Method 1: Launch Ubuntu terminal using keyboard shortcut To open a terminal, you can press Ctrl, Alt and T keys together.
To display the current working directory, we use the pwd command in the Linux/Unix system as shown below. To display the physical directory instead of symbolic links or soft links, we use -P option with the pwd command in the Linux/Unix system as shown below.
There's the package shell-here
available in ELPA: M-x list-packages
, look for shell-here
, mark for install (i
) and execute (x
).
An excerpt of the readme:
Open a shell buffer in (or relative to) default-directory,
e.g. whatever directory the current buffer is in. If you have
find-file-in-project installed, you can also move around relative
to the root of the current project.
I use Emacs shell buffers for everything, and shell-here is great
for getting where you need to quickly. The =find-file-in-project=
integration makes it very easy to manage multiple shells and
maintain your path / history / scrollback when switching between
projects.
github home: https://github.com/ieure/shell-here
And I like shell-pop
too, to pop up and pop out a shell buffer window with one easily. And there's maybe more in ELPA !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With