/*
* $Log$
+ * Revision 1.5 2008/02/28 15:37:06 james
+ * *** empty log message ***
+ *
* Revision 1.4 2008/02/28 11:27:48 james
* *** empty log message ***
*
#include "project.h"
-void
+int
cmd_parse (Cmd * c, Context * ctx, char *buf)
{
if (!strcmp (buf, "quit"))
ctx->k->set_size (ctx->k, ctx,atoi(buf+5),0);
else if (!strncmp (buf, "height", 6))
ctx->k->set_size (ctx->k, ctx,0,atoi(buf+6));
- else
- c->error++;
+ else return -1;
+
+return 0;
+
}
if (c->error) {
c->error=0;
+ c->active=0;
cmd_show_status (c, ctx);
return 0;
}
if (key == 13)
{
- cmd_parse (c, ctx, c->buf + 1);
+ if (cmd_parse (c, ctx, c->buf + 1)) {
+ c->error++;
+ } else{
c->active = 0;
+ }
cmd_show_status (c, ctx);
return 0;
}
extern void tty_send_break(TTY *t);
extern void tty_set_flow(TTY *t, int flow);
extern void tty_hangup(TTY *t);
+extern void tty_winch(TTY *t, CRT_Pos size);
extern void tty_parse_reset(Context *c);
extern void tty_analyse(Context *c);
extern TTY_Parser *tty_parser_new(void);
/* serial.c */
extern TTY *serial_open(char *path, int lock_mode);
/* cmd.c */
-extern void cmd_parse(Cmd *c, Context *ctx, char *buf);
+extern int cmd_parse(Cmd *c, Context *ctx, char *buf);
extern void cmd_show_status(Cmd *c, Context *ctx);
extern int cmd_key(Cmd *c, Context *ctx, int key);
extern int cmd_activate(Cmd *c, Context *ctx);
/*
* $Log$
+ * Revision 1.17 2008/02/28 15:37:06 james
+ * *** empty log message ***
+ *
* Revision 1.16 2008/02/28 12:12:25 james
* *** empty log message ***
*
}
+void tty_winch(TTY * t,CRT_Pos size)
+{
+ struct winsize sz = { 0 };
+
+ sz.ws_col=size.x;
+ sz.ws_row=size.y;
+
+ ioctl (t->wfd, TIOCGWINSZ, &sz);
+}
+
+
+
#if 0
typedef struct
{