unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Abhiseck Paira <abhiseckpaira@disroot.org>
To: Hongyi Zhao <hongyi.zhao@gmail.com>
Cc: "Óscar Fuentes" <ofv@wanadoo.es>, help-gnu-emacs@gnu.org
Subject: Re: Run multiple shells in Emacs.
Date: Tue, 01 Jun 2021 08:53:12 +0530	[thread overview]
Message-ID: <8735u2gten.fsf@disroot.org> (raw)
In-Reply-To: <CAGP6POK8Lq05ubfAPwgMijMmj9qF9DWVFO8yJqfJ_n-yVOTGiA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1971 bytes --]


> 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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2021-06-01  3:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 23:13 Run multiple shells in Emacs Hongyi Zhao
2021-05-31 23:18 ` Jean Louis
2021-05-31 23:23 ` Óscar Fuentes
2021-05-31 23:54   ` Hongyi Zhao
2021-06-01  3:23     ` Abhiseck Paira [this message]
2021-06-01 11:21       ` Leo Butler
2021-06-02  0:52         ` Hongyi Zhao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735u2gten.fsf@disroot.org \
    --to=abhiseckpaira@disroot.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@gmail.com \
    --cc=ofv@wanadoo.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).