/[qemacs]/qemacs/shell.c
ViewVC logotype

Diff of /qemacs/shell.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by chqrlie, Wed May 11 12:13:56 2005 UTC revision 1.15 by chqrlie, Wed Jun 1 23:43:37 2005 UTC
# Line 127  static int run_process(const char *path, Line 127  static int run_process(const char *path,
127      struct winsize ws;      struct winsize ws;
128    
129      pty_fd = get_pty(tty_name);      pty_fd = get_pty(tty_name);
130      fcntl(pty_fd, F_SETFL, O_NONBLOCK);      if (pty_fd < 0) {
131      if (pty_fd < 0)          put_status(NULL, "cannot get tty");
132          return -1;          return -1;
133        }
134        fcntl(pty_fd, F_SETFL, O_NONBLOCK);
135      /* set dummy screen size */      /* set dummy screen size */
136      ws.ws_col = 80;      ws.ws_col = 80;
137      ws.ws_row = 25;      ws.ws_row = 25;
# Line 139  static int run_process(const char *path, Line 140  static int run_process(const char *path,
140      ioctl(pty_fd, TIOCSWINSZ, &ws);      ioctl(pty_fd, TIOCSWINSZ, &ws);
141            
142      pid = fork();      pid = fork();
143      if (pid < 0)      if (pid < 0) {
144            put_status(NULL, "cannot fork");
145          return -1;          return -1;
146        }
147      if (pid == 0) {      if (pid == 0) {
148          /* child process */          /* child process */
149          nb_fds = getdtablesize();          nb_fds = getdtablesize();
# Line 497  void shell_key(void *opaque, int key) Line 500  void shell_key(void *opaque, int key)
500          } else {          } else {
501              p = NULL;              p = NULL;
502          }          }
503            break;
504      }      }
505      if (p)      if (p)
506          tty_write(s, p, len);          tty_write(s, p, len);
# Line 677  static void tty_emulate(ShellState *s, i Line 681  static void tty_emulate(ShellState *s, i
681              switch (ESC2(s->esc1,c)) {              switch (ESC2(s->esc1,c)) {
682              case ESC2('?','h'): /* set terminal mode */              case ESC2('?','h'): /* set terminal mode */
683                  /* 1047, 1048 -> cup mode:                  /* 1047, 1048 -> cup mode:
684                     * xterm 1049 private mode,
685                   * should grab all keys while active!                   * should grab all keys while active!
686                   */                   */
687                  if (s->esc_params[0] == 1047) {                  if (s->esc_params[0] == 1047 ||
688                        s->esc_params[0] == 1048 ||
689                        s->esc_params[0] == 1049) {
690                      s->grab_keys = 1;                      s->grab_keys = 1;
691                      qe_grab_keys(shell_key, s);                      qe_grab_keys(shell_key, s);
692                        /* Should also clear screen */
693                  }                  }
694                  break;                  break;
695              case ESC2('?','l'): /* reset terminal mode */              case ESC2('?','l'): /* reset terminal mode */
696                  if (s->esc_params[0] == 1047) {                  if (s->esc_params[0] == 1047 ||
697                        s->esc_params[0] == 1048 ||
698                        s->esc_params[0] == 1049) {
699                      qe_ungrab_keys();                      qe_ungrab_keys();
700                      s->grab_keys = 0;                      s->grab_keys = 0;
701                  }                  }
# Line 1301  static CmdDef shell_commands[] = { Line 1311  static CmdDef shell_commands[] = {
1311      CMD1( KEY_CTRL('d'), KEY_DELETE, "shell-delete-char", shell_write_char, 4)      CMD1( KEY_CTRL('d'), KEY_DELETE, "shell-delete-char", shell_write_char, 4)
1312      CMD1( KEY_CTRL('i'), KEY_NONE, "shell-tabulate", shell_write_char, 9)      CMD1( KEY_CTRL('i'), KEY_NONE, "shell-tabulate", shell_write_char, 9)
1313      CMD1( KEY_CTRL('k'), KEY_NONE, "shell-kill-line", shell_write_char, 11)      CMD1( KEY_CTRL('k'), KEY_NONE, "shell-kill-line", shell_write_char, 11)
1314        CMD1( KEY_CTRL('y'), KEY_NONE, "shell-yank", shell_write_char, 25)
1315      CMD_DEF_END,      CMD_DEF_END,
1316  };  };
1317    

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26