Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: More questions about how to issue a C-SHELL command within a C program Message-ID: <3909@auspex.auspex.com> Date: 16 Aug 90 19:22:26 GMT References: <25285.26c9113d@kuhub.cc.ukans.edu> Organization: Auspex Systems, Santa Clara Lines: 23 >Would someone point me another way to change terminal type within a C program >or give me some hints what I did wrong. I would appreciate any helps. As noted, the environment isn't "global", so setting an environment variable such as TERM in one process won't affect its value in any other existing processes; it'll only affect its initial value in processes forked from that process. If you want to change the value of an environment variable in a process running some arbitrary C program, check whether your system has the "putenv" routine (look for PUTENV(3) in the manual - unless you have some SCO system wherein they "improved" the manuals by changing the names of the sections, in which case I've no idea what the name would be). If not, see whether it has the "setenv" routine. If it has one or the other of those routines, the manual page should show you how to set an environment variable using the routine. Why do you need to change the setting of TERM within a program? The ultimate problem may lie deeper. (Also bear in mind that you should set TERM *before* you call *any* "curses" or "termcap" routines; otherwise, "curses" or "termcap" will start out using the old value of TERM, not the new value.)