# Intermittent "hang" before prompt during ssh sessions

## LavaJoe

OK, this one is a weird one, and I've been searching like crazy to find others with the same issue with little luck...

I am running gentoo with KDE (so using Konsole) & bash, and I have an Intel PRO/1000 (e1000) network card - not sure if any of that is relevant.

Every once in a while (and it usually pretty rare), when I am logged in to another computer via ssh (on local ethernet as well as over the Internet), the session will freeze/hang/pause before displaying the prompt.  The cursor will sit at the start of the line on which the prompt will appear.  If I hit a key (e.g. enter), I will get two prompts right away, showing that the prompt was waiting but not flushing through (or so it seems).  Also, once I waited a minute or so, and it finally flushed through.  I don't think it's a reverse DNS issue, since reverse lookups seem fine, and there is usually no hang - it's very intermittent.

I have gotten this problem when initially logging in (the "Last login" line appears, but prompt does not), when logging out of a machine that was connected from the remote machine (so I'm still ssh'd one level when it exits), and even once when just running a program that produced lots of output (I thought it was hanging in the program until I hit enter and got two prompts).

So I am wondering if this has something to do with ssh, the prompt itself (although I use slightly different prompt strings on different machines), the way the prompt is trying to alter Konsole's title bar, a networking issue (ssh or network card/driver)...?

Even this is not a show stopper, it is annoying, so any help would be greatly appreciated!

-Thanks, LavaJoe

----------

## RazielFMX

I ssh around alot at work on various servers, and I find that if the host needs to re-read my profile, my log in takes longer, or if the target host is busy.

Are you doing anything whacky in you .bashrc/.bash_profile?

----------

## LavaJoe

 *RazielFMX wrote:*   

> I ssh around alot at work on various servers, and I find that if the host needs to re-read my profile, my log in takes longer, or if the target host is busy.
> 
> Are you doing anything whacky in you .bashrc/.bash_profile?

 

Hi - nope, nothing strange in my dot files.  Plus, it's happened even when I am not logging in.  Once it happened after running a program that spit out a lot of output to stdout.  It hung there after the output for a while, and I finally hit enter, at which time I got two prompts (the one that should have been there before plus the one from hitting enter).

-LavaJoe

----------

## LavaJoe

One more data point: it happened again, and I let it sit there for an hour or so.  Finally, I decided to try clicking *left* mouse in the konsole window.  It then flushed the prompt to the screen.

Since clicking left mouse does not send anything to the ssh session (i.e. no character packets would be sent to the host), it must not be a network issue, but rather it must be a konsole [event?] issue.

BTW, I am running modular X, so maybe konsole does not play completely well with the new X...

-LavaJoe

----------

## RazielFMX

Do you have this problem with [Eax]term?

----------

## LavaJoe

 *RazielFMX wrote:*   

> Do you have this problem with [Eax]term?

 

As a matter of fact, I am experimenting with other terms now.  Currently, since I want UTF-8, I am playing with xterm.  One problem is that it does not let me disable bold-faced fonts when using dircolors, etc.  I am working on figuring that out using the source code...

But no, I have not seen the problem yet in xterm.  However, since the problem is random, I will not feel confident until I use it for a while longer.

-LavaJoe

----------

## RazielFMX

I think E/a term support changing bold font settings in .Xdefaults.

----------

## Vaughn

 *LavaJoe wrote:*   

> One more data point: it happened again, and I let it sit there for an hour or so.  Finally, I decided to try clicking *left* mouse in the konsole window.  It then flushed the prompt to the screen.
> 
> Since clicking left mouse does not send anything to the ssh session (i.e. no character packets would be sent to the host), it must not be a network issue, but rather it must be a konsole [event?] issue.
> 
> -LavaJoe

 

Incorrect - clicking on your terminal does in fact send something via SSH, namely the click event.

You can see this behaviour in links, which will happily accept mouse-clicks on menus and buttons.

----------

## LavaJoe

 *Vaughn wrote:*   

>  *LavaJoe wrote:*   One more data point: it happened again, and I let it sit there for an hour or so.  Finally, I decided to try clicking *left* mouse in the konsole window.  It then flushed the prompt to the screen.
> 
> Since clicking left mouse does not send anything to the ssh session (i.e. no character packets would be sent to the host), it must not be a network issue, but rather it must be a konsole [event?] issue.
> 
> -LavaJoe 
> ...

 

Hmm, not sure I see your logic...  If you click a link in a terminal window that is ssh'd to a remote machine, it may open a browser on your machine, but that requires no data to be sent over the ssh shell connection - it's a function of the client.  What I was saying was that no characters are sent to the remote shell by left-clicking.  If data were sent, it would likely be echoed back as garbled characters in the ssh window.

Now if you have an ssh tunnel set up, and you run an X app over the connection, then clicking in the app window (not the ssh window) will certainly cause X packets to be sent over the ssh connection, but they will not be seen by the shell command line itself.

-LavaJoe

----------

