From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: Question: Is there any way to use the bash completion feature from Emacs shell mode. Date: Sun, 9 Oct 2016 18:49:47 -0600 Message-ID: <20161009184049476560792@bob.proulx.com> References: <51ed4bfc-fbb1-9c29-afe9-fafabab3b7ce@yk.rim.or.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1476060632 1457 195.159.176.226 (10 Oct 2016 00:50:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Oct 2016 00:50:32 +0000 (UTC) User-Agent: NeoMutt/20160916 (1.7.0) Cc: help-gnu-emacs@gnu.org To: "ISHIKAWA,chiaki" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 10 02:50:28 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btOnN-0007K7-6W for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Oct 2016 02:50:21 +0200 Original-Received: from localhost ([::1]:46650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btOnL-0006IM-I2 for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Oct 2016 20:50:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btOmv-0006IB-Sc for help-gnu-emacs@gnu.org; Sun, 09 Oct 2016 20:49:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1btOmr-0002EJ-MA for help-gnu-emacs@gnu.org; Sun, 09 Oct 2016 20:49:52 -0400 Original-Received: from havoc.proulx.com ([96.88.95.61]:45947) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1btOmr-0002E4-Fw for help-gnu-emacs@gnu.org; Sun, 09 Oct 2016 20:49:49 -0400 Original-Received: from joseki.proulx.com (localhost [127.0.0.1]) by havoc.proulx.com (Postfix) with ESMTP id 755F717BC; Sun, 9 Oct 2016 18:49:48 -0600 (MDT) Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 3532F2125A; Sun, 9 Oct 2016 18:49:48 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id 15B162DC5C; Sun, 9 Oct 2016 18:49:47 -0600 (MDT) Mail-Followup-To: "ISHIKAWA,chiaki" , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <51ed4bfc-fbb1-9c29-afe9-fafabab3b7ce@yk.rim.or.jp> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 96.88.95.61 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111488 Archived-At: ISHIKAWA,chiaki wrote: > However, due to various reasons, I prefer to run bash inside Emacs's shell > buffer. It is easy to copy&paste the result of bash output and reuse > commands is one reason. (I am so used to keyboard and copy&paste using mouse > or other pointing device takes much longer.) > > Unfortunately, bash's completion feature does not work in Emacs shell mode. > Obviously, [TAB] is stolen by Emacs for its own handling of TAB character. > Emacs's tab completion for filenames works great. > But I would like Bash's completion somehow works, too. > > Is there a way? > Am I missing the obvious? > (Does using eshell mode helps?) You mention emacs shell mode. But if you want bash to handle the completion then I think maybe you want emacs term mode with bash. Using term mode is different from using shell mode. But you get exactly the bash features you wish. M-x term Note that most C-x keys are remapped to C-c inside that buffer. https://www.gnu.org/software/emacs/manual/html_node/emacs/Terminal-emulator.html#Terminal-emulator Keys are mapped: https://www.gnu.org/software/emacs/manual/html_node/emacs/Term-Mode.html#Term-Mode The buffer is allocated a separate tty. The result is that most keys are passed through directly to bash and therefore all bash completion works from bash without emacs in between. Bob