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

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

Re: Run multiple shells in Emacs.


From: Abhiseck Paira
Subject: Re: Run multiple shells in Emacs.
Date: Tue, 01 Jun 2021 08:53:12 +0530

> I want to use Emacs as an advanced terminal multiplexer similar to
> tmux. Now, I find the method described here:
> <https://iloveemacs.wordpress.com/2014/09/10/emacs-as-an-advanced-terminal-multiplexer/comment-page-1/>.
> Any hints/comments/suggestions will be highly appreciated.

When I first started using Emacs, I wanted to recreate tmux+terminal
workflow with Emacs. So I tried to use *shell* and found it inadequate
because I tried to run TUI (not CLI) applications and it would complain
that terminal wasn't fully operational. Also if I use *term* then I
don't get to use the Emacs keybindings.

Then I read this article[1] and it opened my eyes.
[1] https://ambrevar.xyz/emacs-eshell/index.html

I was thinking it wrong, why does terminal emulator and POSIX shell
should go together? I should be able to use POSIX shell without using a
terminal emulator.

So the first thing I did was to remove all TUI applications. So I use
Emacs packages and CLI programs. CLI programs can easily be used in
*shell* (with Bash running) without any problem. The benefits are:

1. You can have as many buffers running shell as you want.
"C-u M-x shell" will create as many shell buffers as you want.

2. You get to use Emacs keybindings and other Emacs perks everywhere in
a buffer. (See shell manual for details).

I also added this option in my init.el file:
(setq shell-command-switch "-ic")

This makes it possible to type "M-!" and "M-&" and run shell commands
from anywhere in Emacs. Also in dired mode you can type ! and & to run
shell commands with the file at point.

So this is what I have done with my workflow, sometimes I go by weeks
without needing to open a proper terminal emulator. I was even
considering uninstalling it, but thought it may come in handy in
emergency situations.

-- 
Abhisek Paira
E34E 825B 979E EB9F 8505  F80E E93D 353B 7740 0709
"There is no system but GNU, and Linux is one of its kernels."

Attachment: signature.asc
Description: PGP signature


reply via email to

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