Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open terminal in current directory?

Tags:

emacs

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?

like image 688
Frank Cheng Avatar asked Dec 19 '13 05:12

Frank Cheng


People also ask

How do I open the current directory in terminal Windows?

Simply type in wt in the address bar and it will open the command prompt with the path to your current folder already set.

How do I open the current directory in terminal Mac?

To see the current directory you're in in the Terminal, type pwd , which stands for “print working directory”.

What is the shortcut to open terminal in current directory Ubuntu?

Method 1: Launch Ubuntu terminal using keyboard shortcut To open a terminal, you can press Ctrl, Alt and T keys together.

How do I open the current directory in Unix?

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.


1 Answers

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 !

like image 91
Ehvince Avatar answered Sep 18 '22 21:09

Ehvince