Visit Our UNIX and Linux User Community


Putty and wrapping on SunOS 5.9


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Putty and wrapping on SunOS 5.9
# 1  
Old 08-31-2009
Putty and wrapping on SunOS 5.9

I am very frustrated with this. I've added the following into my .profile and .bashrc:

Code:
#this one makes sure that long commands strings line wrap to the next line
[ -z "$PS1" ] && return

#instead of wrapping onto the start of the same line.
shopt -s checkwinsize

However, it just never works for me. Whenever I type a long command, it manages to wrap on the same line while overwriting text. I use putty to ssh and I thought it may be something with putty, but I don't know.

My putty settings has something checked that says:
"Auto wrap mode initially on"

The backspace key is set to Control-H
The home and Esc keys are set to Standard
The function keys and keypad are set to ESC[n~
# 2  
Old 08-31-2009
Login using your putty account and execute the stty -a command as well as tput cols and paste the results into a reply here. The first will give us an idea of how your terminal settings are configured on the server, and the second will tell what the terminal driver thinks your terminal width is.

Also, do you have a customized command prompt? Does it look like [user@host ~]$ or is it different? If it's different, what's different about it: color, bold, reverse video...?
# 3  
Old 09-01-2009
Here you go...

speed 38400 baud;
rows = 24; columns = 120; ypixels = 0; xpixels = 0;
csdata ?
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^h; kill = ^x;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff -parext
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3

----tput cols----
120
# 4  
Old 09-01-2009
Those settings look fine, but you didn't answer the question about your Bash prompt.

The Bash prompt requires \[ and \] around any non-printing sequence inside the prompt in order for Bash to correctly count the number of printable characters that will appear on the screen. It uses that information in combination with the terminfo automargin flag to determine if/when to advance to the next line.

You can type set and hit Enter to see all of the Bash variables; look at the PS1 variable and make sure that non-printable sequences (such as color or other terminal attributes) are enclosed within the sequences I gave above.
# 5  
Old 09-03-2009
Maybe it's related to the reverse

My PS1 is:

Code:
${Reverse}${System_Id}${Normal} ${ORACLE_SID}:${PWD}>

May the reverse is causing a problem.
# 6  
Old 09-03-2009
Yep, if those are non-printing characters or escape sequences. Use the technique I listed above to enclose the Reverse and Normal strings and things should be fine. If not, post back here again.
# 7  
Old 09-03-2009
ok, so I did this:

Code:
\[${Reverse}${System_Id}${Normal} ${ORACLE_SID}:${PWD}> \]

Now it wraps, but once it wraps and gets to the end of the prompt, it wraps on the same line again. After that, it will wrap regularly.

Any idea how to fix that?
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #25
Difficulty: Easy
Google was the first search engine developed for indexing the Internet.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

UNIX mail and wrapping

Greetings, I am by no means a Unix expert and hope that someone here can help me out. I am sending an email from within a Progress character program. This works fine. My issue is that I would like to send more than 80 characters and the email is wrapping at 80 chars. Is this an email... (9 Replies)
Discussion started by: Nosredna
9 Replies

2. Shell Programming and Scripting

SELECT and wrapping to next column

Hi all, Am trying to write a menu driven script using SELECT and if I have more than 4 options, it wraps to the next column. That is if I have 6 choices, items 5 and 6 are in the second column. Is there any settings that control this behavior or is it due to some stty settings? stty -a... (3 Replies)
Discussion started by: newbie_01
3 Replies

3. Shell Programming and Scripting

wrapping text not exceeding 80 characters

I have a file where the text might exceed 80 characters. I want to have the maximum text lengths to be 80, and cut text from a space. I written an awk script below but does not seem to work very well { gsub("\t"," ") $0 = line $0 while (length <= WIDTH) { line = $0 ... (3 Replies)
Discussion started by: kristinu
3 Replies

4. Shell Programming and Scripting

Line Wrapping using Sed

Hi, I want to wrap the lines if a line starts with number. I tried the following sed command, but I do not get the required output. It is replacing the first number. Can some one please help me on this? Command I used sed -e :a -e '$!N;s/\n//;ta' -e 'P;D' testfile I/P file:... (2 Replies)
Discussion started by: christineidanny
2 Replies

5. Shell Programming and Scripting

automatic word wrapping

Hallo, I want to have this Output: Name Street Phone Mail Favorite_thing_o f_what_ever_you_ want Jak street1 0123 jak@test blue egs .com O'Neill street2 4567 ... (1 Reply)
Discussion started by: wiseguy
1 Replies

6. Shell Programming and Scripting

Wrapping ksh script

Hi folks, We want to protect our ksh scripts from our customers.We don't want to let them the option to viewor modify the scripts. Is there a way ro wrap a ksh script? Thanks in advance, Nir (2 Replies)
Discussion started by: nir_s
2 Replies

7. UNIX for Advanced & Expert Users

Migration of binary file from Sunos 5.8 to Sunos 5.9

I have compiled binary file using "cc" on SunOS 5.8 and the same binary file i have copied to SunOS 5.9 and it is giving me core dump error.I want to know whether migration of compiled code from lower version to higer version created this problem. how can i solve this problem.I am pasting the core... (1 Reply)
Discussion started by: Arvind Maurya
1 Replies

8. Shell Programming and Scripting

Line wrapping problem when using awk

I am fairly new at this, I wrote a awk program to give me some summary information about a file. At the end of the program I want to print some variables but for some reason it keeps wrapping the last variable on a new line in the output file. Here is the print command print "99", file_id,... (1 Reply)
Discussion started by: placroix1
1 Replies

9. Shell Programming and Scripting

Wrapping a bash script for CGI

I hope its ok to start a new thread, I was going to use my existing one but thought a new one would better clarify things and provide better search for future reference. Well I have my bash program working now, all nice, user input validated, output formatted, everything is looking sexy. Now... (2 Replies)
Discussion started by: andyj
2 Replies

Featured Tech Videos