2 * pterm - a fusion of the PuTTY terminal emulator with a Unix pty
3 * back end, all running as a GTK application. Wish me luck.
15 #include <gdk/gdkkeysyms.h>
17 #define PUTTY_DO_GLOBALS /* actually _define_ globals */
20 #define CAT2(x,y) x ## y
21 #define CAT(x,y) CAT2(x,y)
22 #define ASSERT(x) enum {CAT(assertion_,__LINE__) = 1 / (x)}
24 #define NCOLOURS (lenof(((Config *)0)->colours))
29 GdkFont
*fonts
[2]; /* normal and bold (for now!) */
30 GdkCursor
*rawcursor
, *textcursor
;
31 GdkColor cols
[NCOLOURS
];
33 GdkGC
*black_gc
, *white_gc
;
34 int font_width
, font_height
;
37 static struct gui_data the_inst
;
38 static struct gui_data
*inst
= &the_inst
; /* so we always write `inst->' */
39 static int send_raw_mouse
;
41 void ldisc_update(int echo
, int edit
)
44 * This is a stub in pterm. If I ever produce a Unix
45 * command-line ssh/telnet/rlogin client (i.e. a port of plink)
46 * then it will require some termios manoeuvring analogous to
47 * that in the Windows plink.c, but here it's meaningless.
51 int askappend(char *filename
)
54 * FIXME: for the moment we just wipe the log file. Since I
55 * haven't yet enabled logging, this shouldn't matter yet!
60 void logevent(char *string
)
63 * FIXME: event log entries are currently ignored.
68 * Translate a raw mouse button designation (LEFT, MIDDLE, RIGHT)
69 * into a cooked one (SELECT, EXTEND, PASTE).
71 * In Unix, this is not configurable; the X button arrangement is
72 * rock-solid across all applications, everyone has a three-button
73 * mouse or a means of faking it, and there is no need to switch
74 * buttons around at all.
76 Mouse_Button
translate_button(Mouse_Button button
)
78 if (button
== MBT_LEFT
)
80 if (button
== MBT_MIDDLE
)
82 if (button
== MBT_RIGHT
)
84 return 0; /* shouldn't happen */
88 * Minimise or restore the window in response to a server-side
91 void set_iconic(int iconic
)
93 /* FIXME: currently ignored */
97 * Move the window in response to a server-side request.
99 void move_window(int x
, int y
)
101 /* FIXME: currently ignored */
105 * Move the window to the top or bottom of the z-order in response
106 * to a server-side request.
108 void set_zorder(int top
)
110 /* FIXME: currently ignored */
114 * Refresh the window in response to a server-side request.
116 void refresh_window(void)
118 /* FIXME: currently ignored */
122 * Maximise or restore the window in response to a server-side
125 void set_zoomed(int zoomed
)
127 /* FIXME: currently ignored */
131 * Report whether the window is iconic, for terminal reports.
135 return 0; /* FIXME */
139 * Report the window's position, for terminal reports.
141 void get_window_pos(int *x
, int *y
)
143 *x
= 3; *y
= 4; /* FIXME */
147 * Report the window's pixel size, for terminal reports.
149 void get_window_pixels(int *x
, int *y
)
151 *x
= 1; *y
= 2; /* FIXME */
155 * Return the window or icon title.
157 char *get_window_title(int icon
)
159 return "FIXME: window title retrieval not yet implemented";
162 gint
delete_window(GtkWidget
*widget
, GdkEvent
*event
, gpointer data
)
165 * FIXME: warn on close?
170 gint
configure_area(GtkWidget
*widget
, GdkEventConfigure
*event
, gpointer data
)
172 struct gui_data
*inst
= (struct gui_data
*)data
;
175 gdk_pixmap_unref(inst
->pixmap
);
177 inst
->pixmap
= gdk_pixmap_new(widget
->window
,
178 cfg
.width
* inst
->font_width
,
179 cfg
.height
* inst
->font_height
, -1);
181 inst
->black_gc
= widget
->style
->black_gc
;
182 inst
->white_gc
= widget
->style
->white_gc
;
185 * Set up the colour map.
187 inst
->colmap
= gdk_colormap_get_system();
189 static const int ww
[] = {
190 6, 7, 8, 9, 10, 11, 12, 13,
191 14, 15, 16, 17, 18, 19, 20, 21,
194 gboolean success
[NCOLOURS
];
197 assert(lenof(ww
) == NCOLOURS
);
199 for (i
= 0; i
< NCOLOURS
; i
++) {
200 inst
->cols
[i
].red
= cfg
.colours
[ww
[i
]][0] * 0x0101;
201 inst
->cols
[i
].green
= cfg
.colours
[ww
[i
]][1] * 0x0101;
202 inst
->cols
[i
].blue
= cfg
.colours
[ww
[i
]][2] * 0x0101;
205 gdk_colormap_alloc_colors(inst
->colmap
, inst
->cols
, NCOLOURS
,
206 FALSE
, FALSE
, success
);
207 for (i
= 0; i
< NCOLOURS
; i
++) {
209 g_error("pterm: couldn't allocate colour %d (#%02x%02x%02x)\n",
210 i
, cfg
.colours
[i
][0], cfg
.colours
[i
][1], cfg
.colours
[i
][2]);
217 gint
expose_area(GtkWidget
*widget
, GdkEventExpose
*event
, gpointer data
)
219 /* struct gui_data *inst = (struct gui_data *)data; */
222 * Pass the exposed rectangle to terminal.c, which will call us
223 * back to do the actual painting.
226 event
->area
.x
/ inst
->font_width
,
227 event
->area
.y
/ inst
->font_height
,
228 (event
->area
.x
+ event
->area
.width
- 1) / inst
->font_width
,
229 (event
->area
.y
+ event
->area
.height
- 1) / inst
->font_height
);
233 #define KEY_PRESSED(k) \
234 (inst->keystate[(k) / 32] & (1 << ((k) % 32)))
236 gint
key_event(GtkWidget
*widget
, GdkEventKey
*event
, gpointer data
)
238 /* struct gui_data *inst = (struct gui_data *)data; */
242 if (event
->type
== GDK_KEY_PRESS
) {
246 printf("keypress: keyval = %04x, state = %08x; string =",
247 event
->keyval
, event
->state
);
248 for (i
= 0; event
->string
[i
]; i
++)
249 printf(" %02x", (unsigned char) event
->string
[i
]);
256 * - Shift-PgUp/PgDn for scrollbar
259 * - Compose key (!!! requires Unicode faff before even trying)
260 * - Shift-Ins for paste (need to deal with pasting first)
263 /* ALT+things gives leading Escape. */
265 strncpy(output
+1, event
->string
, 31);
267 end
= strlen(output
);
268 if (event
->state
& GDK_MOD1_MASK
)
273 /* Control-` is the same as Control-\ (unless gtk has a better idea) */
274 if (!event
->string
[0] && event
->keyval
== '`' &&
275 (event
->state
& GDK_CONTROL_MASK
)) {
280 /* Control-Break is the same as Control-C */
281 if (event
->keyval
== GDK_Break
&&
282 (event
->state
& GDK_CONTROL_MASK
)) {
287 /* Control-2, Control-Space and Control-@ are NUL */
288 if (!event
->string
[0] &&
289 (event
->keyval
== ' ' || event
->keyval
== '2' ||
290 event
->keyval
== '@') &&
291 (event
->state
& (GDK_SHIFT_MASK
|
292 GDK_CONTROL_MASK
)) == GDK_CONTROL_MASK
) {
297 /* Control-Shift-Space is 160 (ISO8859 nonbreaking space) */
298 if (!event
->string
[0] && event
->keyval
== ' ' &&
299 (event
->state
& (GDK_SHIFT_MASK
| GDK_CONTROL_MASK
)) ==
300 (GDK_SHIFT_MASK
| GDK_CONTROL_MASK
)) {
305 /* We don't let GTK tell us what Backspace is! We know better. */
306 if (event
->keyval
== GDK_BackSpace
&&
307 !(event
->state
& GDK_SHIFT_MASK
)) {
308 output
[1] = cfg
.bksp_is_delete ?
'\x7F' : '\x08';
312 /* Shift-Tab is ESC [ Z */
313 if (event
->keyval
== GDK_ISO_Left_Tab
||
314 (event
->keyval
== GDK_Tab
&& (event
->state
& GDK_SHIFT_MASK
))) {
315 end
= 1 + sprintf(output
+1, "\033[Z");
319 * Application keypad mode.
321 if (app_keypad_keys
&& !cfg
.no_applic_k
) {
323 switch (event
->keyval
) {
324 case GDK_Num_Lock
: xkey
= 'P'; break;
325 case GDK_KP_Divide
: xkey
= 'Q'; break;
326 case GDK_KP_Multiply
: xkey
= 'R'; break;
327 case GDK_KP_Subtract
: xkey
= 'S'; break;
329 * Keypad + is tricky. It covers a space that would
330 * be taken up on the VT100 by _two_ keys; so we
331 * let Shift select between the two. Worse still,
332 * in xterm function key mode we change which two...
335 if (cfg
.funky_type
== 2) {
336 if (event
->state
& GDK_SHIFT_MASK
)
340 } else if (event
->state
& GDK_SHIFT_MASK
)
345 case GDK_KP_Enter
: xkey
= 'M'; break;
346 case GDK_KP_0
: case GDK_KP_Insert
: xkey
= 'p'; break;
347 case GDK_KP_1
: case GDK_KP_End
: xkey
= 'q'; break;
348 case GDK_KP_2
: case GDK_KP_Down
: xkey
= 'r'; break;
349 case GDK_KP_3
: case GDK_KP_Page_Down
: xkey
= 's'; break;
350 case GDK_KP_4
: case GDK_KP_Left
: xkey
= 't'; break;
351 case GDK_KP_5
: case GDK_KP_Begin
: xkey
= 'u'; break;
352 case GDK_KP_6
: case GDK_KP_Right
: xkey
= 'v'; break;
353 case GDK_KP_7
: case GDK_KP_Home
: xkey
= 'w'; break;
354 case GDK_KP_8
: case GDK_KP_Up
: xkey
= 'x'; break;
355 case GDK_KP_9
: case GDK_KP_Page_Up
: xkey
= 'y'; break;
356 case GDK_KP_Decimal
: case GDK_KP_Delete
: xkey
= 'n'; break;
360 if (xkey
>= 'P' && xkey
<= 'S')
361 end
= 1 + sprintf(output
+1, "\033%c", xkey
);
363 end
= 1 + sprintf(output
+1, "\033?%c", xkey
);
365 end
= 1 + sprintf(output
+1, "\033O%c", xkey
);
371 * Next, all the keys that do tilde codes. (ESC '[' nn '~',
372 * for integer decimal nn.)
374 * We also deal with the weird ones here. Linux VCs replace F1
375 * to F5 by ESC [ [ A to ESC [ [ E. rxvt doesn't do _that_, but
376 * does replace Home and End (1~ and 4~) by ESC [ H and ESC O w
381 switch (event
->keyval
) {
383 code
= (event
->state
& GDK_SHIFT_MASK ?
23 : 11);
386 code
= (event
->state
& GDK_SHIFT_MASK ?
24 : 12);
389 code
= (event
->state
& GDK_SHIFT_MASK ?
25 : 13);
392 code
= (event
->state
& GDK_SHIFT_MASK ?
26 : 14);
395 code
= (event
->state
& GDK_SHIFT_MASK ?
28 : 15);
398 code
= (event
->state
& GDK_SHIFT_MASK ?
29 : 17);
401 code
= (event
->state
& GDK_SHIFT_MASK ?
31 : 18);
404 code
= (event
->state
& GDK_SHIFT_MASK ?
32 : 19);
407 code
= (event
->state
& GDK_SHIFT_MASK ?
33 : 20);
410 code
= (event
->state
& GDK_SHIFT_MASK ?
34 : 21);
443 if (!(event
->state
& GDK_CONTROL_MASK
)) switch (event
->keyval
) {
444 case GDK_Home
: case GDK_KP_Home
:
447 case GDK_Insert
: case GDK_KP_Insert
:
450 case GDK_Delete
: case GDK_KP_Delete
:
453 case GDK_End
: case GDK_KP_End
:
456 case GDK_Page_Up
: case GDK_KP_Page_Up
:
459 case GDK_Page_Down
: case GDK_KP_Page_Down
:
463 /* Reorder edit keys to physical order */
464 if (cfg
.funky_type
== 3 && code
<= 6)
465 code
= "\0\2\1\4\5\3\6"[code
];
467 if (vt52_mode
&& code
> 0 && code
<= 6) {
468 end
= 1 + sprintf(output
+1, "\x1B%c", " HLMEIG"[code
]);
472 if (cfg
.funky_type
== 5 && /* SCO function keys */
473 code
>= 11 && code
<= 34) {
474 char codes
[] = "MNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz@[\\]^_`{";
476 switch (event
->keyval
) {
477 case GDK_F1
: index
= 0; break;
478 case GDK_F2
: index
= 1; break;
479 case GDK_F3
: index
= 2; break;
480 case GDK_F4
: index
= 3; break;
481 case GDK_F5
: index
= 4; break;
482 case GDK_F6
: index
= 5; break;
483 case GDK_F7
: index
= 6; break;
484 case GDK_F8
: index
= 7; break;
485 case GDK_F9
: index
= 8; break;
486 case GDK_F10
: index
= 9; break;
487 case GDK_F11
: index
= 10; break;
488 case GDK_F12
: index
= 11; break;
490 if (event
->state
& GDK_SHIFT_MASK
) index
+= 12;
491 if (event
->state
& GDK_CONTROL_MASK
) index
+= 24;
492 end
= 1 + sprintf(output
+1, "\x1B[%c", codes
[index
]);
495 if (cfg
.funky_type
== 5 && /* SCO small keypad */
496 code
>= 1 && code
<= 6) {
497 char codes
[] = "HL.FIG";
502 end
= 1 + sprintf(output
+1, "\x1B[%c", codes
[code
-1]);
506 if ((vt52_mode
|| cfg
.funky_type
== 4) && code
>= 11 && code
<= 24) {
513 end
= 1 + sprintf(output
+1,
514 "\x1B%c", code
+ 'P' - 11 - offt
);
516 end
= 1 + sprintf(output
+1,
517 "\x1BO%c", code
+ 'P' - 11 - offt
);
520 if (cfg
.funky_type
== 1 && code
>= 11 && code
<= 15) {
521 end
= 1 + sprintf(output
+1, "\x1B[[%c", code
+ 'A' - 11);
524 if (cfg
.funky_type
== 2 && code
>= 11 && code
<= 14) {
526 end
= 1 + sprintf(output
+1, "\x1B%c", code
+ 'P' - 11);
528 end
= 1 + sprintf(output
+1, "\x1BO%c", code
+ 'P' - 11);
531 if (cfg
.rxvt_homeend
&& (code
== 1 || code
== 4)) {
532 end
= 1 + sprintf(output
+1, code
== 1 ?
"\x1B[H" : "\x1BOw");
536 end
= 1 + sprintf(output
+1, "\x1B[%d~", code
);
542 * Cursor keys. (This includes the numberpad cursor keys,
543 * if we haven't already done them due to app keypad mode.)
545 * Here we also process un-numlocked un-appkeypadded KP5,
546 * which sends ESC [ G.
550 switch (event
->keyval
) {
551 case GDK_Up
: case GDK_KP_Up
: xkey
= 'A'; break;
552 case GDK_Down
: case GDK_KP_Down
: xkey
= 'B'; break;
553 case GDK_Right
: case GDK_KP_Right
: xkey
= 'C'; break;
554 case GDK_Left
: case GDK_KP_Left
: xkey
= 'D'; break;
555 case GDK_Begin
: case GDK_KP_Begin
: xkey
= 'G'; break;
559 * The arrow keys normally do ESC [ A and so on. In
560 * app cursor keys mode they do ESC O A instead.
561 * Ctrl toggles the two modes.
564 end
= 1 + sprintf(output
+1, "\033%c", xkey
);
565 } else if (!app_cursor_keys
^
566 !(event
->state
& GDK_CONTROL_MASK
)) {
567 end
= 1 + sprintf(output
+1, "\033O%c", xkey
);
569 end
= 1 + sprintf(output
+1, "\033[%c", xkey
);
580 printf("generating sequence:");
581 for (i
= start
; i
< end
; i
++)
582 printf(" %02x", (unsigned char) output
[i
]);
586 ldisc_send(output
+start
, end
-start
, 1);
593 gint
timer_func(gpointer data
)
595 /* struct gui_data *inst = (struct gui_data *)data; */
601 void pty_input_func(gpointer data
, gint sourcefd
, GdkInputCondition condition
)
603 /* struct gui_data *inst = (struct gui_data *)data; */
607 ret
= read(sourcefd
, buf
, sizeof(buf
));
610 * Clean termination condition is that either ret == 0, or ret
611 * < 0 and errno == EIO. Not sure why the latter, but it seems
614 if (ret
== 0 || (ret
< 0 && errno
== EIO
)) {
619 perror("read pty master");
623 from_backend(0, buf
, ret
);
627 void destroy(GtkWidget
*widget
, gpointer data
)
632 gint
focus_event(GtkWidget
*widget
, GdkEventFocus
*event
, gpointer data
)
634 has_focus
= event
->in
;
641 * set or clear the "raw mouse message" mode
643 void set_raw_mouse_mode(int activate
)
645 activate
= activate
&& !cfg
.no_mouse_rep
;
646 send_raw_mouse
= activate
;
648 gdk_window_set_cursor(inst
->area
->window
, inst
->rawcursor
);
650 gdk_window_set_cursor(inst
->area
->window
, inst
->textcursor
);
653 void request_resize(int w
, int h
)
655 /* FIXME: currently ignored */
658 void palette_set(int n
, int r
, int g
, int b
)
660 /* FIXME: currently ignored */
662 void palette_reset(void)
664 /* FIXME: currently ignored */
667 void write_clip(wchar_t * data
, int len
, int must_deselect
)
669 /* FIXME: currently ignored */
672 void get_clip(wchar_t ** p
, int *len
)
675 /* FIXME: currently nonfunctional */
681 void set_title(char *title
)
683 /* FIXME: currently ignored */
686 void set_icon(char *title
)
688 /* FIXME: currently ignored */
691 void set_sbar(int total
, int start
, int page
)
693 /* FIXME: currently ignored */
696 void sys_cursor(int x
, int y
)
699 * This is meaningless under X.
708 int CharWidth(Context ctx
, int uc
)
711 * Under X, any fixed-width font really _is_ fixed-width.
712 * Double-width characters will be dealt with using a separate
713 * font. For the moment we can simply return 1.
718 Context
get_ctx(void)
721 if (!inst
->area
->window
)
723 gc
= gdk_gc_new(inst
->area
->window
);
727 void free_ctx(Context ctx
)
729 GdkGC
*gc
= (GdkGC
*)ctx
;
734 * Draw a line of text in the window, at given character
735 * coordinates, in given attributes.
737 * We are allowed to fiddle with the contents of `text'.
739 void do_text(Context ctx
, int x
, int y
, char *text
, int len
,
740 unsigned long attr
, int lattr
)
743 GdkGC
*gc
= (GdkGC
*)ctx
;
747 * - ATTR_WIDE (is this for Unicode CJK? I hope so)
748 * - LATTR_* (ESC # 4 double-width and double-height stuff)
749 * - cursor shapes other than block
750 * - VT100 line drawing stuff; code pages in general!
755 nfg
= 2 * ((attr
& ATTR_FGMASK
) >> ATTR_FGSHIFT
);
756 nbg
= 2 * ((attr
& ATTR_BGMASK
) >> ATTR_BGSHIFT
);
757 if (attr
& ATTR_REVERSE
) {
762 if (cfg
.bold_colour
&& (attr
& ATTR_BOLD
))
764 if (cfg
.bold_colour
&& (attr
& ATTR_BLINK
))
766 if (attr
& TATTR_ACTCURS
) {
771 gdk_gc_set_foreground(gc
, &inst
->cols
[nbg
]);
772 gdk_draw_rectangle(inst
->pixmap
, gc
, 1,
773 x
*inst
->font_width
, y
*inst
->font_height
,
774 len
*inst
->font_width
, inst
->font_height
);
776 gdk_gc_set_foreground(gc
, &inst
->cols
[nfg
]);
777 gdk_draw_text(inst
->pixmap
, inst
->fonts
[0], gc
, x
*inst
->font_width
,
778 y
*inst
->font_height
+ inst
->fonts
[0]->ascent
, text
, len
);
780 if (attr
& ATTR_UNDER
) {
781 int uheight
= inst
->fonts
[0]->ascent
+ 1;
782 if (uheight
>= inst
->font_height
)
783 uheight
= inst
->font_height
- 1;
784 gdk_draw_line(inst
->pixmap
, gc
, x
*inst
->font_width
,
785 y
*inst
->font_height
+ uheight
,
786 (x
+len
)*inst
->font_width
-1, y
*inst
->font_height
+uheight
);
789 gdk_draw_pixmap(inst
->area
->window
, gc
, inst
->pixmap
,
790 x
*inst
->font_width
, y
*inst
->font_height
,
791 x
*inst
->font_width
, y
*inst
->font_height
,
792 len
*inst
->font_width
, inst
->font_height
);
795 void do_cursor(Context ctx
, int x
, int y
, char *text
, int len
,
796 unsigned long attr
, int lattr
)
799 GdkGC
*gc
= (GdkGC
*)ctx
;
802 * NYI: cursor shapes other than block
804 if (attr
& TATTR_PASCURS
) {
805 attr
&= ~TATTR_PASCURS
;
809 do_text(ctx
, x
, y
, text
, len
, attr
, lattr
);
811 gdk_gc_set_foreground(gc
, &inst
->cols
[NCOLOURS
-1]);
812 gdk_draw_rectangle(inst
->pixmap
, gc
, 0,
813 x
*inst
->font_width
, y
*inst
->font_height
,
814 len
*inst
->font_width
-1, inst
->font_height
-1);
815 gdk_draw_pixmap(inst
->area
->window
, gc
, inst
->pixmap
,
816 x
*inst
->font_width
, y
*inst
->font_height
,
817 x
*inst
->font_width
, y
*inst
->font_height
,
818 len
*inst
->font_width
, inst
->font_height
);
822 void modalfatalbox(char *p
, ...)
825 fprintf(stderr
, "FATAL ERROR: ");
827 vfprintf(stderr
, p
, ap
);
833 int main(int argc
, char **argv
)
836 extern int pty_master_fd
; /* declared in pty.c */
838 gtk_init(&argc
, &argv
);
840 do_defaults(NULL
, &cfg
);
842 inst
->fonts
[0] = gdk_font_load(cfg
.font
);
843 inst
->fonts
[1] = NULL
; /* FIXME: what about bold font? */
844 inst
->font_width
= gdk_char_width(inst
->fonts
[0], ' ');
845 inst
->font_height
= inst
->fonts
[0]->ascent
+ inst
->fonts
[0]->descent
;
850 back
->init(NULL
, 0, NULL
, 0);
852 window
= gtk_window_new(GTK_WINDOW_TOPLEVEL
);
853 inst
->area
= gtk_drawing_area_new();
854 gtk_drawing_area_size(GTK_DRAWING_AREA(inst
->area
),
855 inst
->font_width
* cfg
.width
,
856 inst
->font_height
* cfg
.height
);
858 gtk_container_add(GTK_CONTAINER(window
), inst
->area
);
860 gtk_signal_connect(GTK_OBJECT(window
), "destroy",
861 GTK_SIGNAL_FUNC(destroy
), inst
);
862 gtk_signal_connect(GTK_OBJECT(window
), "delete_event",
863 GTK_SIGNAL_FUNC(delete_window
), inst
);
864 gtk_signal_connect(GTK_OBJECT(window
), "key_press_event",
865 GTK_SIGNAL_FUNC(key_event
), inst
);
866 gtk_signal_connect(GTK_OBJECT(window
), "focus_in_event",
867 GTK_SIGNAL_FUNC(focus_event
), inst
);
868 gtk_signal_connect(GTK_OBJECT(window
), "focus_out_event",
869 GTK_SIGNAL_FUNC(focus_event
), inst
);
870 gtk_signal_connect(GTK_OBJECT(inst
->area
), "configure_event",
871 GTK_SIGNAL_FUNC(configure_area
), inst
);
872 gtk_signal_connect(GTK_OBJECT(inst
->area
), "expose_event",
873 GTK_SIGNAL_FUNC(expose_area
), inst
);
874 gtk_timeout_add(20, timer_func
, inst
);
875 gdk_input_add(pty_master_fd
, GDK_INPUT_READ
, pty_input_func
, inst
);
876 gtk_widget_add_events(GTK_WIDGET(inst
->area
),
877 GDK_KEY_PRESS_MASK
| GDK_KEY_RELEASE_MASK
);
879 gtk_widget_show(inst
->area
);
880 gtk_widget_show(window
);
882 inst
->textcursor
= gdk_cursor_new(GDK_XTERM
);
883 inst
->rawcursor
= gdk_cursor_new(GDK_ARROW
);
884 gdk_window_set_cursor(inst
->area
->window
, inst
->textcursor
);
887 term_size(24, 80, 2000);