From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: Open multiple separate terminal buffers with multi-term in Emacs. Date: Wed, 2 Jun 2021 17:35:30 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14590"; mail-complaints-to="usenet@ciao.gmane.io" To: Hongyi Zhao , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 02 11:36:09 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1loNIG-0003Ti-Px for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 02 Jun 2021 11:36:08 +0200 Original-Received: from localhost ([::1]:46152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1loNIF-000412-70 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 02 Jun 2021 05:36:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1loNHs-00040R-R2 for help-gnu-emacs@gnu.org; Wed, 02 Jun 2021 05:35:44 -0400 Original-Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:38400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1loNHr-0006ea-66 for help-gnu-emacs@gnu.org; Wed, 02 Jun 2021 05:35:44 -0400 Original-Received: by mail-lf1-x12d.google.com with SMTP id r5so2365867lfr.5 for ; Wed, 02 Jun 2021 02:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=aYZJbVk7fDfpC6lZ4R/Tbuo/RElzVt6tGmIrAp8cOWo=; b=tQCZkcpQ2B476oo56lHGDTLfkbBxxeQWEn/xWlS+xJZtKfBjAtqkHCVr5sNHHGFY8L XUC03UDlWse3fzVQaFa9T0ZctMrtsIzthtWTRRUL/oocmzHJkT9lm4FeBMqT5hFpM/TA pJgb/a1e6fBJgP3/rplokvcGw31cnjPQEakbOthRD/fkkIv/esDfMbw6yLN/sDZT45m1 Q8xIwsZvIUVJA/eaEGwxHDFa67+Kms/t6dig2jbnRww6SvDOJW7zUeixDZhuzRv2NItz x5FWNiBS4+37PT56NHcmL3YGVkZ+DT//nHVM3k13pYLsHQeCsZrpl62hU/HcxdtowSvX CEAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=aYZJbVk7fDfpC6lZ4R/Tbuo/RElzVt6tGmIrAp8cOWo=; b=ak7s8vrTapgPN0onAnjrXYmenDVF4CQ+hyncsFsA0WoZPMWH59O0jtF73pDpV1OfP2 hvYWhypSUEAwozsEbH3OEKNy8Mlaw8fEDycuJmVV/h+UcqO8EqlXWn+6ch66uemiJCut AcxuiQ5DNCIIpgu3NvRdAr0Rh8KxZcAQn7wM7R96WpNvlYeuDPWbaoq8FqltB6vtOSoH W9IgYjgmeh00z9O0LGzGzTnt8BvzKltMWFd4jmLBh/9mnqN4+v2RR0iG4w5x+hUgZ6Tc g7VQzSKGrvlrfOIKtaUOP7Laq7VgVGCSfiOdofPVD/Vy+y+wX5u2yB31ElPqW2jG80w7 zSLA== X-Gm-Message-State: AOAM531LFegfuY3osrOdQK1iETyGKrhjH3D3Eq+gWVWl2AhPXtQEzW17 NuINOK0+lUJUGDR8b5jUKqeS1f38/Eq2k+RdTz0= X-Google-Smtp-Source: ABdhPJxq7/341c9GmFtOejzG/RmOXNik9xP/loO23wI6injTtSsAx48+k7YJH8uyy8aSU03RjlL/Vi2ik9NIdFBivAY= X-Received: by 2002:ac2:58f0:: with SMTP id v16mr20990489lfo.461.1622626541435; Wed, 02 Jun 2021 02:35:41 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=hongyi.zhao@gmail.com; helo=mail-lf1-x12d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:130493 Archived-At: On Wed, Jun 2, 2021 at 5:28 PM Hongyi Zhao wrote: > > On Wed, Jun 2, 2021 at 11:57 AM Jean Louis wrote: > > > > * Hongyi Zhao [2021-06-02 04:39]: > > > But I noticed that the shell commands issued in one terminal will als= o > > > be shown in the other, i.e., they are the identical one. And I want t= o > > > open multiple separate terminal buffers, with which I can issue > > > different shell commands in them respectively and observe the > > > corresponding executions of them. > > > > You can use `ansi-term' command to open terminal with different program= s: > > > > ansi-term is an autoloaded interactive compiled Lisp function in > > =E2=80=98term.el=E2=80=99. > > > > (ansi-term PROGRAM &optional NEW-BUFFER-NAME) > > > > Probably introduced at or before Emacs version 28.1. > > > > Start a terminal-emulator in a new buffer. > > This is almost the same as =E2=80=98term=E2=80=99 apart from always cre= ating a new buffer, > > and =E2=80=98C-x=E2=80=99 being marked as a =E2=80=98term-escape-char= =E2=80=99. > > > > This below would open 2 different terminals with different shells: > > > > (ansi-term "/bin/bash") > > (ansi-term "/bin/zsh") > > > > You can then use argument to invoke new program in new term. > > > > (defun run-with-term () > > (interactive) > > "Runs new command with term" > > (let ((my-programs '("/bin/bash" "/usr/bin/mc"))) > > (ansi-term (completing-read "Program to run: " my-programs nil nil)= ))) > > > > Thank you. It really does the trick. But how can I get these terminal buffers to be tiled so that switching between them is easy? HY --=20 Assoc. Prof. Hongyi Zhao Theory and Simulation of Materials Hebei Vocational University of Technology and Engineering NO. 552 North Gangtie Road, Xingtai, China