summaryrefslogtreecommitdiff
path: root/core/apps/embeddedkonsole/MyPty.cpp
Unidiff
Diffstat (limited to 'core/apps/embeddedkonsole/MyPty.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/MyPty.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/apps/embeddedkonsole/MyPty.cpp b/core/apps/embeddedkonsole/MyPty.cpp
index 9adc248..7e820ad 100644
--- a/core/apps/embeddedkonsole/MyPty.cpp
+++ b/core/apps/embeddedkonsole/MyPty.cpp
@@ -158,17 +158,18 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int)
158#if defined (TIOCSCTTY) 158#if defined (TIOCSCTTY)
159 // grabbed from APUE by Stevens 159 // grabbed from APUE by Stevens
160 ioctl(STDIN_FILENO, TIOCSCTTY, 0); 160 ioctl(STDIN_FILENO, TIOCSCTTY, 0);
161#endif 161#endif
162 tcgetattr( STDIN_FILENO, &ttmode ); 162 tcgetattr( STDIN_FILENO, &ttmode );
163 ttmode.c_cc[VINTR] = 3; 163 ttmode.c_cc[VINTR] = 3;
164 ttmode.c_cc[VERASE] = 8; 164 ttmode.c_cc[VERASE] = 8;
165 tcsetattr( STDIN_FILENO, TCSANOW, &ttmode ); 165 tcsetattr( STDIN_FILENO, TCSANOW, &ttmode );
166 setenv("TERM","vt100",1); 166 if(strlen(getenv("TERM"))<=0)
167 setenv("TERM","vt100",1);
167 setenv("COLORTERM","0",1); 168 setenv("COLORTERM","0",1);
168 169
169 if (getuid() == 0) { 170 if (getuid() == 0) {
170 char msg[] = "WARNING: You are running this shell as root!\n"; 171 char msg[] = "WARNING: You are running this shell as root!\n";
171 write(ttyfd, msg, sizeof(msg)); 172 write(ttyfd, msg, sizeof(msg));
172 } 173 }
173 174
174 QString ccmd = "-"+QFileInfo(cmd).fileName(); //creates a login shell 175 QString ccmd = "-"+QFileInfo(cmd).fileName(); //creates a login shell