Rodrigo Amestica | 4 Jun 2012 00:44

how to get bash_profile out of the way?

Hi,

it seems that I changed something in my configuration, and now
every time a execute a command (e.g. grep, make, etc.) on the remote
computer I'm visiting then I get in the output buffer my login salute
heading the output of the command. 

As far as I can tell all what I have customized is just the following

'(tramp-auto-save-directory (expand-file-name "~/.emacs.d/tramp.auto-save"))
'(tramp-default-method "ssh")
'(tramp-remote-path (quote (tramp-own-remote-path)))

I cannot understand why is that tramp's connection now triggers my
bash_profile instead of restricting to bashrc. bash is my shell in the
local and remote hosts.

thanks in advance,
 Rodrigo
Michael Albinus | 4 Jun 2012 09:38
Picon
Picon
Gravatar

Re: how to get bash_profile out of the way?

Rodrigo Amestica <ramestica <at> lavabit.com> writes:

> Hi,

Hi,

> it seems that I changed something in my configuration, and now
> every time a execute a command (e.g. grep, make, etc.) on the remote
> computer I'm visiting then I get in the output buffer my login salute
> heading the output of the command. 

Which Tramp version are you running?

> I cannot understand why is that tramp's connection now triggers my
> bash_profile instead of restricting to bashrc. bash is my shell in the
> local and remote hosts.

Asynchronous commands always require a new login on your remote
machine. But Tramp shall remove the initial welcome lines, once it has
reached the prompt.

Could you, please, set `tramp-verbose' to 6 and show Tramp's debug
buffer after your test run?

> thanks in advance,
>  Rodrigo

Best regards, Michael.
Rodrigo Amestica | 4 Jun 2012 17:50

Re: how to get bash_profile out of the way?

Hello Michael,

I tried to understand the problem in the output, but it did not result
clear to me. The output has 152 lines (included below.) First line
includes emacs and tramp versions.

I suppose that the problem is on 'reaching' the prompt.

many thanks,
 Rodrigo

;; GNU Emacs: 23.3.1 Tramp: 2.1.20 -*- mode: outline; -*-
10:55:01.468657 tramp-wait-for-regexp (6) # 
tramp_exit_status 0
///20b768b1eb4c88fad393c837abcec88f#$
10:55:01.470715 tramp-send-command (6) # test -x
/home/isis/frodo/cvs/project/project2/COMP/HEAD/ 2>/dev/null; echo tramp_exit_status $?
10:55:01.488177 tramp-wait-for-regexp (6) # 
tramp_exit_status 0
///20b768b1eb4c88fad393c837abcec88f#$
10:55:01.509864 tramp-maybe-open-connection (3) # Opening connection for comp1 using ssh...
10:55:01.510380 tramp-maybe-open-connection (6) # /bin/sh
10:55:01.517820 tramp-wait-for-regexp (6) # 
#$ 
10:55:01.518462 tramp-maybe-open-connection (3) # Sending command `exec ssh -q   -e none comp1'
10:55:01.518582 tramp-send-command (6) # exec ssh -q   -e none comp1
10:55:01.518855 tramp-process-actions (3) # Waiting for prompts from remote shell
10:55:02.118697 tramp-process-one-action (5) # Looking for regexp "\(.*ogin\( .*\)?: *\)\'" from
remote shell
10:55:02.119523 tramp-process-one-action (5) # Looking for regexp "\(^.*\([pP]assword\|[pP]assphrase\).*:
(Continue reading)

Michael Albinus | 5 Jun 2012 12:34
Picon
Picon
Gravatar

Re: how to get bash_profile out of the way?

Rodrigo Amestica <ramestica <at> lavabit.com> writes:

> Hello Michael,

Hi Rodrigo,

> I tried to understand the problem in the output, but it did not result
> clear to me. The output has 152 lines (included below.) First line
> includes emacs and tramp versions.
>
> ;; GNU Emacs: 23.3.1 Tramp: 2.1.20 -*- mode: outline; -*-

I see. I could reproduce the problem with these Emacs/Tramp versions. And
I even remember it vaguely :-)

This problem is solved in Tramp 2.2. Either you upgrade to Emacs 24.1
(including Tramp 2.2.3), which is expected to be released next days. Or
you install the recent Tramp 2.2.5, keeping Emacs 23.3. I've checked
with both Emacs/Tramp constellations, no problem there.

> many thanks,
>  Rodrigo

Best regards, Michael.
Rodrigo Amestica | 5 Jun 2012 14:02

Re: how to get bash_profile out of the way?

On Tue, 05 Jun 2012 12:34:05 +0200,
Michael Albinus <michael.albinus <at> gmx.de> wrote:
> Rodrigo Amestica <ramestica <at> lavabit.com> writes:
>> Hello Michael,

> Hi Rodrigo,

>> I tried to understand the problem in the output, but it did not result
>> clear to me. The output has 152 lines (included below.) First line
>> includes emacs and tramp versions.
>> 
>> ;; GNU Emacs: 23.3.1 Tramp: 2.1.20 -*- mode: outline; -*-

> I see. I could reproduce the problem with these Emacs/Tramp versions. And
> I even remember it vaguely :-)

> This problem is solved in Tramp 2.2. Either you upgrade to Emacs 24.1
> (including Tramp 2.2.3), which is expected to be released next days. Or
> you install the recent Tramp 2.2.5, keeping Emacs 23.3. I've checked
> with both Emacs/Tramp constellations, no problem there.

I really appreciate your time looking into my report.

I have updated to 2.2.5 and now it works better, but there is still
one artifact. My prompt consists of two lines: path to current
directory followed by a new-line character and then followed by the
more standard 'VER username <at> host >' (whence VER is the value of an
environment variable that remembers me my application version).

I do not see my bash_profile salute anymore, but the first line of the
(Continue reading)

Michael Albinus | 5 Jun 2012 16:17
Picon
Picon
Gravatar

Re: how to get bash_profile out of the way?

Rodrigo Amestica <ramestica <at> lavabit.com> writes:

Hi Rodrigo,

> I have updated to 2.2.5 and now it works better, but there is still
> one artifact. My prompt consists of two lines: path to current
> directory followed by a new-line character and then followed by the
> more standard 'VER username <at> host >' (whence VER is the value of an
> environment variable that remembers me my application version).

In the traces you have sent I see

--8<---------------cut here---------------start------------->8---
Last login: Mon Jun  4 10:54:42 2012 from trauko.cv.nrao.edu

Hi Master! Welcome to comp1 (COMP).

PROJECTSW_RELEASE=SW-10.1
LINUX_HOME=/project/SW-10.1/rtlinux
RTOS_HOME=/project/SW-10.1/rtos
SWROOT=/project/SW-10.1/SWSW
SW_CDB=/home/isis/frodo/cvs/project/project2/COMP/HEAD/CORR/config/Simulation
SW_LOG_STDOUT=3
INTROOT=/home/isis/frodo/introot/10.1/COMP/HEAD
INTLISTROOT=/home/isis/projectmgr/INTLIST-HEAD
MODULES=/home/isis/frodo/cvs/project/project2/COMP/HEAD
MANAGER_REFERENCE=
lp -d RICOH-Aficio-MP-C3001 -o sides=two-sided-long-edge~

HEAD frodo <at> comp1 > 
(Continue reading)

Rodrigo Amestica | 6 Jun 2012 00:43

Re: how to get bash_profile out of the way?

On Tue, 05 Jun 2012 16:17:10 +0200,
Michael Albinus <michael.albinus <at> gmx.de> wrote:
> Rodrigo Amestica <ramestica <at> lavabit.com> writes:
> Hi Rodrigo,

>> I have updated to 2.2.5 and now it works better, but there is still
>> one artifact. My prompt consists of two lines: path to current
>> directory followed by a new-line character and then followed by the
>> more standard 'VER username <at> host >' (whence VER is the value of an
>> environment variable that remembers me my application version).

> In the traces you have sent I see

> --8<---------------cut here---------------start------------->8---
> Last login: Mon Jun  4 10:54:42 2012 from trauko.cv.nrao.edu

> Hi Master! Welcome to comp1 (COMP).

> PROJECTSW_RELEASE=SW-10.1
> LINUX_HOME=/project/SW-10.1/rtlinux
> RTOS_HOME=/project/SW-10.1/rtos
> SWROOT=/project/SW-10.1/SWSW
> SW_CDB=/home/isis/frodo/cvs/project/project2/COMP/HEAD/CORR/config/Simulation
> SW_LOG_STDOUT=3
> INTROOT=/home/isis/frodo/introot/10.1/COMP/HEAD
> INTLISTROOT=/home/isis/projectmgr/INTLIST-HEAD
> MODULES=/home/isis/frodo/cvs/project/project2/COMP/HEAD
> MANAGER_REFERENCE=
> lp -d RICOH-Aficio-MP-C3001 -o sides=two-sided-long-edge~

(Continue reading)

Michael Albinus | 8 Jun 2012 11:18
Picon
Picon
Gravatar

Re: how to get bash_profile out of the way?

Rodrigo Amestica <ramestica <at> lavabit.com> writes:

Hi Rodrigo,

> looking at my original message I see that the empty line in your reply
> looks different. In my original message I see the following instead:
>
> lp -d RICOH-Aficio-MP-C3001 -o sides=two-sided-long-edge
> ~
>
> HEAD frodo <at> comp1 > 

In the traces I see, that the newline between the two prompt lines is
<CR><LF> in reality. So it looks like

lp -d RICOH-Aficio-MP-C3001 -o sides=two-sided-long-edge
^B~^M
HEAD frodo <at> comp1 > 

Maybe both lines could be interpreted as a prompt, which might confuse
Tramp. If the first line is already regarded as prompt, it would mean
that the second line (the real prompt) is kept unhandled, or whatever.

You have the following options:

1- Change the prompt on the remote machine to be better
recognizable. The Tramp manual gives you some hints, how to do it.

2. Check your settings of tramp-shell-prompt-pattern and
shell-prompt-pattern that they do match only the last line of your
(Continue reading)

Rodrigo Amestica | 4 Jan 2013 18:55

Re: how to get bash_profile out of the way?

Hello Michael,

a lot of time has passed since then. first a short recapitulation: it
seems that my bash command prompt containing two lines confuses tramp
and grep or compile outputs would include my remote login salute,
making the buffers unsuited for proper 'f12' browsing.

recently I have updated to emacs 24.2.1 which implies tramp 2.2.3-24.1
and now the problem has gone away! Still having a bash prompt with two
lines now I get clean grep or compile buffers which I can beautifully
browse with f12! An incredible life improvement!

Days after the update I noticed that trying to dired directories with
too many files would provoke a 'Stack overflow' error. Quickly I found
this posting

http://lists.gnu.org/archive/html/tramp-devel/2012-06/msg00000.html

and right away patched tramp.el. Now dired works good! But shortly
after that I'm discovering that now I'm back to the original polluted
buffer problem. My remote salute is again intermixed with grep or
compile outputs. 

Does this help understanding the cause of my original problem? For now
I have disabled the 'Stack overflow' patch.

thanks,
 Rodrigo
Michael Albinus | 7 Jan 2013 13:46
Picon
Picon
Gravatar

Re: how to get bash_profile out of the way?

Rodrigo Amestica <ramestica <at> lavabit.com> writes:

> Hello Michael,

Hi Rodrigo,

> recently I have updated to emacs 24.2.1 which implies tramp 2.2.3-24.1
> and now the problem has gone away! Still having a bash prompt with two
> lines now I get clean grep or compile buffers which I can beautifully
> browse with f12! An incredible life improvement!
>
> Days after the update I noticed that trying to dired directories with
> too many files would provoke a 'Stack overflow' error. Quickly I found
> this posting
>
> http://lists.gnu.org/archive/html/tramp-devel/2012-06/msg00000.html
>
> and right away patched tramp.el. Now dired works good! But shortly
> after that I'm discovering that now I'm back to the original polluted
> buffer problem. My remote salute is again intermixed with grep or
> compile outputs. 
>
> Does this help understanding the cause of my original problem? For now
> I have disabled the 'Stack overflow' patch.

Hmm, I've read the old thread. We have been working on fixing this with
Tramp 2.2.5. This release contains the patch you have mentioned.

OTOH, Emacs 24.2 comes with Tramp 2.2.3, without that patch. 

(Continue reading)

Rodrigo Amestica | 10 Jan 2013 04:59

Re: how to get bash_profile out of the way?

Hi Michael,

I have installed 2.2.6 and now both problems are gone:

1. polluted grep/compile buffers with login salute
2. dired 'stack overflow' in directory with ~2800 files

A bit unexpected! Because you said that 2.2.6 contains the patch
linked in my previous message then I expected that in 2.2.6 #2 would be
resolved but not #1. 

The difference seems to be that the patch in the link is not the same
as the actual code in 2.2.6.

All in all, with 2.2.6 I am a really happy camper!

many thanks,
 Rodrigo  
Michael Albinus | 10 Jan 2013 08:02
Picon
Picon
Gravatar

Re: how to get bash_profile out of the way?

Rodrigo Amestica <ramestica <at> lavabit.com> writes:

> Hi Michael,

Hi Rodrigo,

> I have installed 2.2.6 and now both problems are gone:
>
> 1. polluted grep/compile buffers with login salute
> 2. dired 'stack overflow' in directory with ~2800 files
>
> A bit unexpected! Because you said that 2.2.6 contains the patch
> linked in my previous message then I expected that in 2.2.6 #2 would be
> resolved but not #1. 
>
> The difference seems to be that the patch in the link is not the same
> as the actual code in 2.2.6.

Finally, problem #1 was reported (again) via
<http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12203>. And this is fixed
in Tramp 2.2.6.

> All in all, with 2.2.6 I am a really happy camper!

Have fun! Tramp 2.2.6 is bundled with the upcoming Emacs 24.3.

> many thanks,
>  Rodrigo  

Best regards, Michael.
(Continue reading)


Gmane