From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Loris Bennett" Newsgroups: gmane.emacs.help Subject: Re: [TRAMP] Setting remote prompt Date: Tue, 24 Apr 2018 10:15:46 +0200 Organization: Freie Universitaet Berlin Message-ID: <87r2n5ggul.fsf@hornfels.zedat.fu-berlin.de> References: <87vachghmp.fsf@hornfels.zedat.fu-berlin.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1524557920 4225 195.159.176.226 (24 Apr 2018 08:18:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 24 Apr 2018 08:18:40 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 24 10:18:36 2018 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 1fAt9l-0000xA-AF for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Apr 2018 10:18:33 +0200 Original-Received: from localhost ([::1]:57098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fAtBr-0000mD-Up for geh-help-gnu-emacs@m.gmane.org; Tue, 24 Apr 2018 04:20:43 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-X-Trace: news.uni-berlin.de JxzHIkTIX2nchzaVdl9aqw6JPgioI2ML0NU4dPJsB6O0W+ Cancel-Lock: sha1:xQKfu88UAfApJCEJp2bC9d+BAL8= Original-Xref: usenet.stanford.edu gnu.emacs.help:222468 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:116586 Archived-At: "Loris Bennett" writes: > Hi, > > When logged in on a remote machine I have the following prompt: > > [09:15:09] loris@pi (1000) ~ > $ echo $PS1 > \[\033]2;\u@\h\a\]\[\e[35m\][\t] \[\e[31m\]\u@\h \[\e[36m\](\!) \[\e[33m\]\w\[\e[34m\]\[\033[0m\]\n$ > > When I access a file on the remote machine via TRAMP and then do 'M-x > shell', I get: > > ^[]2;loris@pi^G[09:42:03] loris@pi (30) ~ > $ echo $PS1 > \[\033]2;\u@\h\a\]\[\e[35m\][\t] \[\e[31m\]\u@\h \[\e[36m\](\!) \[\e[33m\]\w\[\e[34m\]\[\033[0m\]\n$ > > where ^[ and ^G are the non-printable characters and  respectively. > > I see that here: > > https://www.gnu.org/software/tramp/#Remote-shell-setup > > the way to reset the prompt via ~/.emacs_SHELLNAME is described. > > However, I was wondering if there is just a simple way to prevent TRAMP > from adding a default prompt to the front of the existing prompt (if, > indeed, that is what is happening). > > Does anyone one have any advice? Looking again I see that PS1 isn't changed, so the difference is probably due to the way the prompt is interpreted by the terminal. First I need to work out what the first instance of '\u@\h' is there for, as it's been a few years since I set it up. -- This signature is currently under construction.