shell을 하나 더 실행하고 싶을 때

less than 1 minute read

M-x shell

shell 버퍼가 없으면 만든다. 있으면? 만든 shell 버퍼로 전환한다. 이 명령어로는 shell 버퍼를 여러 개 만들 수 없다.

원하는 만큼 shell 버퍼를 새로 만들려면 함수를 만들어야 할까? 패키지를 찾아봐야 하나?

C-u M-x shell

아니다. 간단하다. C-u 키만 먼저 입력하면 된다. 미니버퍼에 shell 버퍼를 입력하라는 프롬프트가 뜬다. 다른 이름을 입력하거나 귀찮으면 그냥 RET 키만 누르면 새로운 shell 버퍼가 나타난다.

C-h f shell

(shell &optional BUFFER)

Run an inferior shell, with I/O through BUFFER (which defaults to ‘*shell*’).
Interactively, a prefix arg means to prompt for BUFFER.
If ‘default-directory’ is a remote file name, it is also prompted
to change if called with a prefix arg.

If BUFFER exists but shell process is not running, make new shell.
If BUFFER exists and shell process is running, just switch to BUFFER.

[.]

도움말 잘 읽어야겠다. 첫 번째 문단만 읽으면 shell 버퍼 이름을 설정할 수 있다지만 두 번째 문단까지 읽으면 새로운 shell 버퍼를 만들 수 있단 걸 알게 된다.

C-x C-s C-x C-c