# HG changeset patch # User John W. Eaton # Date 1367389444 14400 # Node ID e84b77df8940ddba4fa699ed0bb0385b31823c5c # Parent 49832f60282e2d10f9522f97d489bbfe37fb802d ensure TERM environment variable is set when GUI starts * octave-gui.cc (octave_start_gui): If TERM environment variable is not set, set it to "xterm". diff -r 49832f60282e -r e84b77df8940 libgui/src/octave-gui.cc --- a/libgui/src/octave-gui.cc Wed May 01 02:02:21 2013 -0400 +++ b/libgui/src/octave-gui.cc Wed May 01 02:24:04 2013 -0400 @@ -49,7 +49,7 @@ static void dissociate_terminal (void) { -#if ! defined (Q_OS_WIN32) || defined (Q_OS_CYGWIN) +#if ! defined (__WIN32__) || defined (__CYGWIN__) # if defined (HAVE_SYS_IOCTL_H) && defined (TIOCNOTTY) ioctl (0, TIOCNOTTY); @@ -115,6 +115,17 @@ // update network-settings resource_manager::update_network_settings (); +#if ! defined (__WIN32__) || defined (__CYGWIN__) + // If we were started from a launcher, TERM might not be + // defined, but we provide a terminal with xterm + // capabilities. + + std::string term = octave_env::getenv ("TERM"); + + if (term.empty ()) + octave_env::putenv ("TERM", "xterm"); +#endif + // create main window, read settings, and show window main_window w; w.read_settings (); // get widget settings after construction