|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Running "GNU screen", I have a little problem with "cat". I have a file
with one very long line, and when I 'cat' the file in a terminal window in screen (the terminal window is 80x25 - as shown in "stty -a"), it truncates the characters between positions 81 and 145. I.e., the display is like this: 123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789- X... where X is the 146th char of the line, and ... is the remainder of the line after char 146. If I use something like 'less' to display the file, it comes up correctly. I.e., I think 'less' honors the "stty" settings, but somehow 'cat' does not. Further, if you test with this command line: gawk 'BEGIN {for (i=1; i<30; i++) printf("%10d",i) rint ""}'you get this output: 1 2 3 4 5 6 7 9 (weird that the last character on the line is "9", not "8"). If you pipe the above gawk command line into 'less' then everything is fine. Anyway, I'm pretty sure all of my 'stty' settings of 'rows' and 'columns' are correct, in all of the involved ttys. I think something in screen got screwed up. This is a very long-running instance of 'screen', that I would rather not re-start, so I'd prefer to be able to fix it. I know that screen has zillions of internal parameters that can be messed with (and, thus, messed up). Can anyone suggest something that may be the cause of this? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Dec 25, 6:32 pm, gaze...@xmission.xmission.com (Kenny McCormack)
wrote: > Running "GNU screen", I have a little problem with "cat". I have a file > with one very long line, and when I 'cat' the file in a terminal window > in screen (the terminal window is 80x25 - as shown in "stty -a"), it > truncates the characters between positions 81 and 145. I.e., the > display is like this: > 123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789- > X... > > where X is the 146th char of the line, and ... is the remainder of the > line after char 146. > > If I use something like 'less' to display the file, it comes up > correctly. I.e., I think 'less' honors the "stty" settings, but somehow > 'cat' does not. > > Further, if you test with this command line: > > gawk 'BEGIN {for (i=1; i<30; i++) printf("%10d",i) rint ""}'> > you get this output: > > 1 2 3 4 5 6 7 9 > > (weird that the last character on the line is "9", not "8"). > If you pipe the above gawk command line into 'less' then everything is > fine. > > Anyway, I'm pretty sure all of my 'stty' settings of 'rows' and > 'columns' are correct, in all of the involved ttys. I think something > in screen got screwed up. This is a very long-running instance of > 'screen', that I would rather not re-start, so I'd prefer to be able > to fix it. > > I know that screen has zillions of internal parameters that can be > messed with (and, thus, messed up). Can anyone suggest something that > may be the cause of this? SilverNail:~# gawk 'BEGIN {for (i=1; i<30; i++) printf("%10d",i) rint""}' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2425 26 27 28 29 SilverNail:~# |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Wed, 26 Dec 2007 00:32:39 +0000 (UTC), Kenny McCormack wrote:
[...] > gawk 'BEGIN {for (i=1; i<30; i++) printf("%10d",i) rint ""}'> > you get this output: > > 1 2 3 4 5 6 7 9 > > (weird that the last character on the line is "9", not "8"). [...] "9" might be the "9" of "29". Could be that you have "wrap" off. Try <Ctrl-A>r. -- Stephane |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
In article <477b7a65$0$897$ba4acef3@news.orange.fr>,
Stephane Chazelas <stephane_chazelas@yahoo.fr> wrote: >On Wed, 26 Dec 2007 00:32:39 +0000 (UTC), Kenny McCormack wrote: >[...] >> gawk 'BEGIN {for (i=1; i<30; i++) printf("%10d",i) rint ""}'>> >> you get this output: >> >> 1 2 3 4 5 6 7 >9 >> >> (weird that the last character on the line is "9", not "8"). >[...] > >"9" might be the "9" of "29". Could be that you have "wrap" off. >Try <Ctrl-A>r. > >-- >Stephane This is now sorted (as of a day or two after original post). It turns out there were two things going on (in some, but not all, of the windows). (Somehow) wrap got turned off. And (somehow) the window size (as seen in the output of ^Ai) got set to 145. After fixing both of these things, things are back to normal now. Note that fixing the window size is *not* easy. I think this all happened after I accidentally did ^AS, which splits the window. I think that sets some things that are hard to un-do. In general, I think the split window feature is a good idea in theory, but not useful in practice. I've tried it a few times (often by accident), but never was comfortable with it. |
|
![]() |
| Outils de la discussion | |
|
|