LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-16-2014, 10:15 AM   #1
whynotkeithberg
LQ Newbie
 
Registered: Nov 2013
Location: Murder Dubs... Oakland CA
Distribution: RHEL
Posts: 20

Rep: Reputation: Disabled
Issues With Putty


Hello everyone,

I apologize if this is the wrong area to post this as this is software I'm using on Windows. However, I'm connecting to Linux so I wanted to post on here as I'm sure a large number of users here probably use it.

When I'm using Putty (it usually does it worse on one monitor but happens on both which are the same model hooked up to the same machine). When I'm issuing commands or get output from a command that's more than a couple characters long I get an early wrap but it doesn't go down to a new line. The text covers itself up as it wraps around to the same exact line. I wanted to attach a screenshot and will as soon as I get a chance but it doesn't always have the issue and of course even though it was doing it at the start of this post as soon as I tried to recreate it for a screenshot it stopped doing it.

I searched around but I couldn't find a phrasing that found any matches even though I'm sure there are some.

Any help is appreciated or just a point in the right direction and I can probably find it from there.

Thanks again!
 
Old 04-16-2014, 10:18 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
If the box you are connecting to has a really crazy PS1 (command prompt) then you can get into really strange emulation issues like this.

On the box you are connecting to what do you get for:

Code:
echo $PS1
 
Old 04-16-2014, 10:23 AM   #3
whynotkeithberg
LQ Newbie
 
Registered: Nov 2013
Location: Murder Dubs... Oakland CA
Distribution: RHEL
Posts: 20

Original Poster
Rep: Reputation: Disabled
It actually happens on almost every server I connect to when it is happening. We have a few thousand servers here that I manage mainly through Puppet & CFEngine but CFEngine is being phased out.

Quote:
[root@ii104-21 (puppet) (08:18:14) /admin/ops/bin]# echo $PS1
\[\e[0;32m\][\u@\h\[\e[0;31m\] (puppet) \[\e[0;32m\](\t) \w]# \[\e[0m\]
 
Old 04-16-2014, 10:35 AM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Ok. Heres the thing.

That WHOLE prompt is made up of what a terminal emulator will see as "non printing characters."

So it will not make adjustments to the line wrap. It will assume, that even though 30 characters are already in use from your prompt, once expanded, that you are in fact at pos 5 on the line. Hence your issue.

The EASIEST way to fix this is:

when you log in, run a quick:

Code:
PS1=[Whatever]#
Or you can look up how non-printing characters affect your line length and fix your prompt globally.

edit: here is the first link regarding it. quick glance says it is what you are looking for.

http://mike.geek-republic.com/2009/0...e-wrap-issues/
 
Old 04-16-2014, 11:57 AM   #5
whynotkeithberg
LQ Newbie
 
Registered: Nov 2013
Location: Murder Dubs... Oakland CA
Distribution: RHEL
Posts: 20

Original Poster
Rep: Reputation: Disabled
Thank you very much for the response. I don't have time to test it out at the moment but after a quick skim it looks like you're most likely right.

Much appreciated.
 
Old 04-21-2014, 11:13 AM   #6
whynotkeithberg
LQ Newbie
 
Registered: Nov 2013
Location: Murder Dubs... Oakland CA
Distribution: RHEL
Posts: 20

Original Poster
Rep: Reputation: Disabled
I've marked this as solved. That definitely fixed it. I'm going to browse through that a bit more... I used: PS1="[\W]\$ \[\e]2;[\d \t] [\w]\a\]" and placed it in my ~/.bash_profile.

That cut off basically everything. I'm trying to play with it a bit. I want it to show my user & server name without it cutting everything off. But still, nice to at least be able to see everything I type for now.

Thanks again.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DNS issues, Downloading issues, Web issues. UbuntuHelp Linux - Networking 1 08-28-2012 07:34 AM
Help with Ubuntu server remote ssh and local network ssh issues using putty. scottpops Linux - Server 8 05-17-2012 05:07 PM
putty imamit76 Linux - General 4 10-23-2009 04:17 AM
Putty logs me out / Putty throws me out after I log in ytd Linux - General 15 08-09-2009 03:03 AM
Putty? your_shadow03 Linux - Newbie 3 08-20-2008 11:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration