terminal setting

terminal setting

Post by morde » Sun, 09 Mar 2003 09:39:02



I'm using a third party library that utilizes curses library.
My program leaves the terminal in raw mode upon the exit.
I could run stty sane at the end before exit, but I'm much rather
restore the original terminal settings in effect before my program
startup even if they're not quite sane... They just have to be cooked :-)

What keywords should I google for? I have a vague idea of how curses
functions look like.

Thank you.

 
 
 

terminal setting

Post by Kevin Easto » Sun, 09 Mar 2003 09:56:30



> I'm using a third party library that utilizes curses library.
> My program leaves the terminal in raw mode upon the exit.
> I could run stty sane at the end before exit, but I'm much rather
> restore the original terminal settings in effect before my program
> startup even if they're not quite sane... They just have to be cooked :-)

> What keywords should I google for? I have a vague idea of how curses
> functions look like.

#include <termios.h>
#include <unistd.h>

static struct termios origmode;

/* ... */

int main()
{
     /* ... */

     tcgetattr(0, &origmode);

     /* ... */

     tcsetattr(0, TCSAFLUSH, &origmode);

     return 0;

Quote:}

You should also check if the tcgetattr() call fails.

        - Kevin.

 
 
 

1. bitkeeper cygwin messed up cygwin terminal setting for tcsh, lynx: dumb terminal?

When I downloaded bitkeeper, it installed a stripped-down (no clue whether
it was the most recent) version of cygwin on top of the version I had
already installed.

Since, I get the following error when loading tcsh:

<<tcsh: No entry for terminal type "cygwin"

tcsh: using dumb terminal settings.>>

or lynx no longer runs and says:

<<Error opening terminal: cygwin.>>

Re-installing cygwin's tcsh wouldn't fix it.

Any hints?


2. DLL and SO differences

3. How do I set up my terminal settings?

4. /dev/random cleanup: 03-entropy-estimation

5. curses.h - (colour setting ) , drawing box , terminal setting

6. freebsd and the natd interface ??

7. Terminal Settings

8. Building X11 Release 6 on Solaris 2.4

9. HELP: Changing the terminal settings

10. Color terminal settings

11. Terminal settings for vi

12. Terminal settings