+ // Query kernel for other params
+ struct ptymode mode;
+ _SysIOCtl(fd, PTY_IOCTL_GETMODE, &mode);
+
+ if( (mode.OutputMode & PTYOMODE_BUFFMT) != PTYBUFFMT_TEXT ) {
+ _SysDebug("Call to tcgetattr when terminal is not in text mode");
+ return -1;
+ }
+
+ if(mode.InputMode & PTYIMODE_CANON)
+ termios_p->c_lflag |= ICANON|ECHOE|ECHOK;
+ if(mode.InputMode & PTYIMODE_ECHO)
+ termios_p->c_lflag |= ECHO;
+ // TODO: The more subtle flags