1777547 Members
1890 Online
109070 Solutions
New Discussion

how to set the terminal

 
SOLVED
Go to solution
jonesliu
Advisor

how to set the terminal

Hi:

I want to build the software(wxWight) in the HP UX 11.31, some errors occur.

But the error message is clearly mangled from the terminal, for unknown reasons.

 

I try to output the message to one document by the command "make >> output.txt", but the error message just is shown on the terminal and won't be written to the document.

 

I try the maximize the terminal , the  message will be more, but still  being truncated.

 

please refer to the compared image.

 

so, how can I get the entire error message via setting the terminal?

 

 

P.S. This thread has been moved from HP-UX-General to  languages. -HP Forum Moderator

 

 

18 REPLIES 18
SoumitraC
Frequent Advisor

Re: how to set the terminal

For redirecting error messages, you need to redirect 'stderr' to your log file.

                  make >> output.txt 2>error.txt

 

Or in case you want everything to go into the same log file,

                  make > output.txt 2>&1

 

Soumitra C
HP-UX Compilers
Bill Hassell
Honored Contributor

Re: how to set the terminal

>> so, how can I get the entire error message via setting the terminal?

 

Unless you can set the terminal line length to 500 or 1000, you'll never see the entire message on one line. And even if you could set the terminal width that large, you could not read it as the characters would only be a few pixels in size.

 

You can always pipe the output from make into cut -c 1-79 but then you'll lose the text at the end on the line. That will show each include on one line. When you redirect the output into a file, the lines will be still be very long. If you edit the file, your display problem will be the same as before.  You might print the file but rotate the text to landscape mode and reduce the font to get everything on one line (if you can read the small font).

 

To troubleshoot the make problem, the very long include lines may be useful as reference but the errors appear to be easitly readable. Using vi, you can edit the output file and search for selected text if necessary.



Bill Hassell, sysadmin
jonesliu
Advisor

Re: how to set the terminal

hi

Unless you can set the terminal line length to 500 or 1000, you'll never see the entire message on one line. And even if you could set the terminal width that large, you could not read it as the characters would only be a few pixels in size.

 

>> I can't find where to set the line length , I try to set the font to 6,5 point, but the error message still being  truncated.

can you kindly tell me how to set the terminal line length to 1000?

 

You can always pipe the output from make into cut -c 1-79 but then you'll lose the text at the end on the line.

>> sorry, I am stranger to Unix OS. can you describe more in detailed about  how to make into cut-c1-79?

     E.g:

      cut -c 79 output.txt

     I think the cut command is used to truncate the file to lower pieces  for readable easily. but first I should get the entire message then I can cut the output file to get more clearly fonts 

  

jonesliu
Advisor

Re: how to set the terminal

Hi Soumitra C

Thanks a lot, The error info can be written t to the file now, but the error message still be truncated

SoumitraC
Frequent Advisor

Re: how to set the terminal

Can you please post the contents of the file as an attachment, possibly gzipped?

 

Thanks!

Soumitra C
HP-UX Compilers
Bill Hassell
Honored Contributor

Re: how to set the terminal

>> I can't find where to set the line length , I try to set the font to 6,5 point, but the error message still being  truncated.

>> can you kindly tell me how to set the terminal line length to 1000?

 

You aren't using a typical terminal emulator, you're using Xwindows, probably xterm or dterm. To get 1000 characters across the screen, you need to change the font size about 2 or 3 points. But there is no font that small and even if you could find a font like that, you could not read it on a normal screen. 

 

In other words, you won't be able to see a 1-line message that is more than about 200 characters with xterm or dterm. However, when you redirect the messages into a fail, there is no practical line length limitation so everything is there. 

 

But it is really important to note that the messages are not truncated.

 

In your first attachment, the last long message starts with: /var/SPS/SPS/wxWidgets

and the end of that line reads:  ../src/common/wxcrt.cpp

 

So everything is there. The very long line is simply folded into 4 lines on your screen. No truncation has occurred.

 



Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: how to set the terminal

>I can't find where to set the line length

 

I'm not sure what your problem is?  If you have long lines, the lines should be wrapped.  You just follow the lines to the logical beginning.  Your picture teminal-larger.png ‏73 KB looks fine.

 

If you don't like that wrapping, you could open the output in a browser as .txt, then you can scroll from left to right.

 

>but the error message still be truncated

 

Not truncated but wrapped.

jonesliu
Advisor

Re: how to set the terminal

The output will be correct when it is built successfully, but the errors  shown in terminal will be truncated when built fail.

 

please refer to the three pictures, the error info  shown in terminal will be different according to the  termimal windows size.

 

But, The error info will be the same if it is writen to the file whenever how to adjust the terminal window.

 

Bill Hassell
Honored Contributor

Re: how to set the terminal

The output.txt file shows that the each message is complete and not truncated. The long messages are folded onto the next several lines. Those extra lines are the original message. If you capture the last long line that starts with:

 

/var/SPS/SPS/wxWidgets...

 

and ends with:

 

../src/common/wxcrt.cpp

 

The line is 539 characters wide. It is one line and is not truncated. If you have to use Xwindows with HP-UX, you can use dtpad (the text editor from CDE) which should allow horizontal scrolling.

 

Or you can see the entire line by transferring the file to a PC and open it in Notepad. When you open the file, if you see the lines folded, then click on the Format menu item, and turn off Word Wrap. Now you will see a single line for each message plus a horizontal scroll bar at the bottom that you can slide to the right for the rest of the line.

 

 



Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: how to set the terminal

>how to adjust the terminal window.

 

Hmm, whatever terminal emulator you're using is just broken?  The lines seem to be interspersed.

One possibility is that you are getting the stdout and stderr output interspersed.

You need to use:

make ... 2>&1 ...

 

Note: If an application is writing to both stdout and stderr, it must do something special so that the output looks reasonable.  It must flush stdout (since buffered) before it writes to stderr.

jonesliu
Advisor

Re: how to set the terminal

Hi

>&1

But it does not work. the error info still be partly.

refer to the attachment

jonesliu
Advisor

Re: how to set the terminal

Hi Bill Hassell:

Yes, if the built succeed, the output info starts with:

 

/var/SPS/SPS/wxWidgets...

 

and ends with:

 

../src/common/wxcrt.cpp

 

but , if the built failed, the error output info starts with:

../src/common/wxcrt.cpp: In function ‘int wxVsscanf(const char*, const char*, void*)’:

 

this line is intercepted.

 

you can compare the three pictures as attachment(1.png, 2.png, 3.png), the errors is different according to the terminal window size.

The error line will contain more info when resize the windows to maximize.

 

The error info will be the same if I input to the file via the command : make  >output.txt  2>&1

Dennis Handly
Acclaimed Contributor

Re: how to set the terminal

>The error line will contain more info when resize the windows to maximize.

 

Then your terminal emulator is just broken.  Nothing you can do except copy the output to your PC.

 

I suppose you could try to suppress stdout and just look at stderr:

make 2>&1 > /dev/null

 

What does "stty -a" show?  Perhaps you don't have the XOFF hand shaking?

You should see ixoff and not -ixoff.

Bill Hassell
Honored Contributor
Solution

Re: how to set the terminal

I agree with Dennis, your terminal (which appears to be dterm) is archaic for Unix system administration and programming. If you are using a PC to view the dterm window, time to shutoff Xwindows and use a real terminal emulator. The best is PuTTY and can be downloaded from:

 

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

 

Then as Dennis suggests, your /etc/profile needs to have a proper stty setup.

Replace the stty lines in /etc/profile with these two lines:

 

stty erase "^H" kill "^U" intr "^C" eof "^D" -parity ixoff
stty susp \^Z dsusp \^Y

 

This will also fix any problems you have had in the past with pasting large amounts of text using vi.



Bill Hassell, sysadmin
jonesliu
Advisor

Re: how to set the terminal

Thanks a lot for all the help, but it sees still can not work.

I have edit the /etc/profile and  use the putty to make the software.

please refer to attachment "putty.png"

 

 

Dennis Handly
Acclaimed Contributor

Re: how to set the terminal (CV qualifier mismatch)

>but it sees still can not work.

 

You need to define what "work" means.  It is now correctly printing the error message.

 

You are illegally trying to call vsscanf passing a const char* to a char*, the output parm.

jonesliu
Advisor

Re: how to set the terminal (CV qualifier mismatch)

Dennis Handly
Acclaimed Contributor

Re: how to set the terminal (CV qualifier mismatch)

>

 

If you're happy with the answers you were given, please click on the Kudos star for each helpful answer.