1 /* Terminal hooks for GNU Emacs on the Microsoft Windows API.
2 Copyright (C) 1992, 1999, 2001-2013 Free Software Foundation, Inc.
4 This file is part of GNU Emacs.
6 GNU Emacs is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
20 Tim Fleehart (apollo@online.com) 1-17-92
21 Geoff Voelker (voelker@cs.washington.edu) 9-12-93
31 #include "character.h"
36 #include "termhooks.h"
38 #include "dispextern.h"
40 #include "w32common.h" /* for os_subtype */
44 extern Lisp_Object
Frecenter (Lisp_Object
);
46 static void w32con_move_cursor (struct frame
*f
, int row
, int col
);
47 static void w32con_clear_to_end (struct frame
*f
);
48 static void w32con_clear_frame (struct frame
*f
);
49 static void w32con_clear_end_of_line (struct frame
*f
, int);
50 static void w32con_ins_del_lines (struct frame
*f
, int vpos
, int n
);
51 static void w32con_insert_glyphs (struct frame
*f
, struct glyph
*start
, int len
);
52 static void w32con_write_glyphs (struct frame
*f
, struct glyph
*string
, int len
);
53 static void w32con_delete_glyphs (struct frame
*f
, int n
);
54 static void w32con_reset_terminal_modes (struct terminal
*t
);
55 static void w32con_set_terminal_modes (struct terminal
*t
);
56 static void w32con_update_begin (struct frame
* f
);
57 static void w32con_update_end (struct frame
* f
);
58 static WORD
w32_face_attributes (struct frame
*f
, int face_id
);
60 static COORD cursor_coords
;
61 static HANDLE prev_screen
, cur_screen
;
62 static WORD char_attr_normal
;
63 static DWORD prev_console_mode
;
65 #ifndef USE_SEPARATE_SCREEN
66 static CONSOLE_CURSOR_INFO prev_console_cursor
;
69 HANDLE keyboard_handle
;
70 int w32_console_unicode_input
;
73 /* Setting this as the ctrl handler prevents emacs from being killed when
74 someone hits ^C in a 'suspended' session (child shell).
75 Also ignore Ctrl-Break signals. */
78 ctrl_c_handler (unsigned long type
)
80 /* Only ignore "interrupt" events when running interactively. */
81 return (!noninteractive
82 && (type
== CTRL_C_EVENT
|| type
== CTRL_BREAK_EVENT
));
86 /* Move the cursor to (ROW, COL) on FRAME. */
88 w32con_move_cursor (struct frame
*f
, int row
, int col
)
90 cursor_coords
.X
= col
;
91 cursor_coords
.Y
= row
;
93 /* TODO: for multi-tty support, cur_screen should be replaced with a
94 reference to the terminal for this frame. */
95 SetConsoleCursorPosition (cur_screen
, cursor_coords
);
98 /* Clear from cursor to end of screen. */
100 w32con_clear_to_end (struct frame
*f
)
102 w32con_clear_end_of_line (f
, FRAME_COLS (f
) - 1);
103 w32con_ins_del_lines (f
, cursor_coords
.Y
, FRAME_LINES (f
) - cursor_coords
.Y
- 1);
106 /* Clear the frame. */
108 w32con_clear_frame (struct frame
*f
)
113 CONSOLE_SCREEN_BUFFER_INFO info
;
115 GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE
), &info
);
117 /* Remember that the screen buffer might be wider than the window. */
118 n
= FRAME_LINES (f
) * info
.dwSize
.X
;
121 FillConsoleOutputAttribute (cur_screen
, char_attr_normal
, n
, dest
, &r
);
122 FillConsoleOutputCharacter (cur_screen
, ' ', n
, dest
, &r
);
124 w32con_move_cursor (f
, 0, 0);
128 static struct glyph glyph_base
[256];
129 static BOOL ceol_initialized
= FALSE
;
131 /* Clear from Cursor to end (what's "standout marker"?). */
133 w32con_clear_end_of_line (struct frame
*f
, int end
)
135 if (!ceol_initialized
)
138 for (i
= 0; i
< 256; i
++)
140 memcpy (&glyph_base
[i
], &space_glyph
, sizeof (struct glyph
));
142 ceol_initialized
= TRUE
;
144 w32con_write_glyphs (f
, glyph_base
, end
- cursor_coords
.X
); /* fencepost ? */
147 /* Insert n lines at vpos. if n is negative delete -n lines. */
149 w32con_ins_del_lines (struct frame
*f
, int vpos
, int n
)
159 scroll
.Top
= vpos
- n
;
160 scroll
.Bottom
= FRAME_LINES (f
);
166 scroll
.Bottom
= FRAME_LINES (f
) - n
;
169 clip
.Top
= clip
.Left
= scroll
.Left
= 0;
170 clip
.Right
= scroll
.Right
= FRAME_COLS (f
);
171 clip
.Bottom
= FRAME_LINES (f
);
175 fill
.Char
.AsciiChar
= 0x20;
176 fill
.Attributes
= char_attr_normal
;
178 ScrollConsoleScreenBuffer (cur_screen
, &scroll
, &clip
, dest
, &fill
);
180 /* Here we have to deal with a w32 console flake: If the scroll
181 region looks like abc and we scroll c to a and fill with d we get
182 cbd... if we scroll block c one line at a time to a, we get cdd...
183 Emacs expects cdd consistently... So we have to deal with that
184 here... (this also occurs scrolling the same way in the other
189 if (scroll
.Bottom
< dest
.Y
)
191 for (i
= scroll
.Bottom
; i
< dest
.Y
; i
++)
193 w32con_move_cursor (f
, i
, 0);
194 w32con_clear_end_of_line (f
, FRAME_COLS (f
));
200 nb
= dest
.Y
+ (scroll
.Bottom
- scroll
.Top
) + 1;
204 for (i
= nb
; i
< scroll
.Top
; i
++)
206 w32con_move_cursor (f
, i
, 0);
207 w32con_clear_end_of_line (f
, FRAME_COLS (f
));
213 cursor_coords
.Y
= vpos
;
222 scroll_line (struct frame
*f
, int dist
, int direction
)
224 /* The idea here is to implement a horizontal scroll in one line to
225 implement delete and half of insert. */
226 SMALL_RECT scroll
, clip
;
230 clip
.Top
= scroll
.Top
= clip
.Bottom
= scroll
.Bottom
= cursor_coords
.Y
;
232 clip
.Right
= FRAME_COLS (f
);
234 if (direction
== LEFT
)
236 scroll
.Left
= cursor_coords
.X
+ dist
;
237 scroll
.Right
= FRAME_COLS (f
) - 1;
241 scroll
.Left
= cursor_coords
.X
;
242 scroll
.Right
= FRAME_COLS (f
) - dist
- 1;
245 dest
.X
= cursor_coords
.X
;
246 dest
.Y
= cursor_coords
.Y
;
248 fill
.Char
.AsciiChar
= 0x20;
249 fill
.Attributes
= char_attr_normal
;
251 ScrollConsoleScreenBuffer (cur_screen
, &scroll
, &clip
, dest
, &fill
);
255 /* If start is zero insert blanks instead of a string at start ?. */
257 w32con_insert_glyphs (struct frame
*f
, register struct glyph
*start
,
260 scroll_line (f
, len
, RIGHT
);
262 /* Move len chars to the right starting at cursor_coords, fill with blanks */
265 /* Print the first len characters of start, cursor_coords.X adjusted
268 w32con_write_glyphs (f
, start
, len
);
272 w32con_clear_end_of_line (f
, cursor_coords
.X
+ len
);
277 w32con_write_glyphs (struct frame
*f
, register struct glyph
*string
,
282 unsigned char *conversion_buffer
;
283 struct coding_system
*coding
;
288 /* If terminal_coding does any conversion, use it, otherwise use
289 safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
290 because it always return 1 if the member src_multibyte is 1. */
291 coding
= (FRAME_TERMINAL_CODING (f
)->common_flags
& CODING_REQUIRE_ENCODING_MASK
292 ? FRAME_TERMINAL_CODING (f
) : &safe_terminal_coding
);
293 /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
295 coding
->mode
&= ~CODING_MODE_LAST_BLOCK
;
299 /* Identify a run of glyphs with the same face. */
300 int face_id
= string
->face_id
;
303 for (n
= 1; n
< len
; ++n
)
304 if (string
[n
].face_id
!= face_id
)
307 /* Turn appearance modes of the face of the run on. */
308 char_attr
= w32_face_attributes (f
, face_id
);
311 /* This is the last run. */
312 coding
->mode
|= CODING_MODE_LAST_BLOCK
;
313 conversion_buffer
= encode_terminal_code (string
, n
, coding
);
314 if (coding
->produced
> 0)
316 /* Set the attribute for these characters. */
317 if (!FillConsoleOutputAttribute (cur_screen
, char_attr
,
318 coding
->produced
, cursor_coords
,
321 printf ("Failed writing console attributes: %d\n",
326 /* Write the characters. */
327 if (!WriteConsoleOutputCharacter (cur_screen
, conversion_buffer
,
328 coding
->produced
, cursor_coords
,
331 printf ("Failed writing console characters: %d\n",
336 cursor_coords
.X
+= coding
->produced
;
337 w32con_move_cursor (f
, cursor_coords
.Y
, cursor_coords
.X
);
344 /* Used for mouse highlight. */
346 w32con_write_glyphs_with_face (struct frame
*f
, register int x
, register int y
,
347 register struct glyph
*string
, register int len
,
348 register int face_id
)
350 unsigned char *conversion_buffer
;
351 struct coding_system
*coding
;
356 /* If terminal_coding does any conversion, use it, otherwise use
357 safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here
358 because it always return 1 if the member src_multibyte is 1. */
359 coding
= (FRAME_TERMINAL_CODING (f
)->common_flags
& CODING_REQUIRE_ENCODING_MASK
360 ? FRAME_TERMINAL_CODING (f
) : &safe_terminal_coding
);
361 /* We are going to write the entire block of glyphs in one go, as
362 they all have the same face. So this _is_ the last block. */
363 coding
->mode
|= CODING_MODE_LAST_BLOCK
;
365 conversion_buffer
= encode_terminal_code (string
, len
, coding
);
366 if (coding
->produced
> 0)
368 DWORD filled
, written
;
369 /* Compute the character attributes corresponding to the face. */
370 DWORD char_attr
= w32_face_attributes (f
, face_id
);
375 /* Set the attribute for these characters. */
376 if (!FillConsoleOutputAttribute (cur_screen
, char_attr
,
377 coding
->produced
, start_coords
,
379 DebPrint (("Failed writing console attributes: %d\n", GetLastError ()));
382 /* Write the characters. */
383 if (!WriteConsoleOutputCharacter (cur_screen
, conversion_buffer
,
384 filled
, start_coords
, &written
))
385 DebPrint (("Failed writing console characters: %d\n",
391 /* Implementation of draw_row_with_mouse_face for W32 console. */
393 tty_draw_row_with_mouse_face (struct window
*w
, struct glyph_row
*row
,
394 int start_hpos
, int end_hpos
,
395 enum draw_glyphs_face draw
)
397 int nglyphs
= end_hpos
- start_hpos
;
398 struct frame
*f
= XFRAME (WINDOW_FRAME (w
));
399 struct tty_display_info
*tty
= FRAME_TTY (f
);
400 int face_id
= tty
->mouse_highlight
.mouse_face_face_id
;
403 if (end_hpos
>= row
->used
[TEXT_AREA
])
404 nglyphs
= row
->used
[TEXT_AREA
] - start_hpos
;
406 pos_y
= row
->y
+ WINDOW_TOP_EDGE_Y (w
);
407 pos_x
= row
->used
[LEFT_MARGIN_AREA
] + start_hpos
+ WINDOW_LEFT_EDGE_X (w
);
409 if (draw
== DRAW_MOUSE_FACE
)
410 w32con_write_glyphs_with_face (f
, pos_x
, pos_y
,
411 row
->glyphs
[TEXT_AREA
] + start_hpos
,
413 else if (draw
== DRAW_NORMAL_TEXT
)
415 COORD save_coords
= cursor_coords
;
417 w32con_move_cursor (f
, pos_y
, pos_x
);
418 write_glyphs (f
, row
->glyphs
[TEXT_AREA
] + start_hpos
, nglyphs
);
419 w32con_move_cursor (f
, save_coords
.Y
, save_coords
.X
);
424 w32con_delete_glyphs (struct frame
*f
, int n
)
426 /* delete chars means scroll chars from cursor_coords.X + n to
427 cursor_coords.X, anything beyond the edge of the screen should
430 scroll_line (f
, n
, LEFT
);
435 w32con_reset_terminal_modes (struct terminal
*t
)
438 CONSOLE_SCREEN_BUFFER_INFO info
;
442 /* Clear the complete screen buffer. This is required because Emacs
443 sets the cursor position to the top of the buffer, but there might
444 be other output below the bottom of the Emacs frame if the screen buffer
445 is larger than the window size. */
446 GetConsoleScreenBufferInfo (cur_screen
, &info
);
449 n
= info
.dwSize
.X
* info
.dwSize
.Y
;
451 FillConsoleOutputAttribute (cur_screen
, char_attr_normal
, n
, dest
, &r
);
452 FillConsoleOutputCharacter (cur_screen
, ' ', n
, dest
, &r
);
453 /* Now that the screen is clear, put the cursor at the top. */
454 SetConsoleCursorPosition (cur_screen
, dest
);
456 #ifdef USE_SEPARATE_SCREEN
457 SetConsoleActiveScreenBuffer (prev_screen
);
459 SetConsoleCursorInfo (prev_screen
, &prev_console_cursor
);
462 SetConsoleMode (keyboard_handle
, prev_console_mode
);
466 w32con_set_terminal_modes (struct terminal
*t
)
468 CONSOLE_CURSOR_INFO cci
;
470 /* make cursor big and visible (100 on Windows 95 makes it disappear) */
473 (void) SetConsoleCursorInfo (cur_screen
, &cci
);
475 SetConsoleActiveScreenBuffer (cur_screen
);
477 SetConsoleMode (keyboard_handle
, ENABLE_MOUSE_INPUT
| ENABLE_WINDOW_INPUT
);
479 /* Initialize input mode: interrupt_input off, no flow control, allow
480 8 bit character input, standard quit char. */
481 Fset_input_mode (Qnil
, Qnil
, make_number (2), Qnil
);
484 /* hmmm... perhaps these let us bracket screen changes so that we can flush
485 clumps rather than one-character-at-a-time...
487 we'll start with not moving the cursor while an update is in progress. */
489 w32con_update_begin (struct frame
* f
)
494 w32con_update_end (struct frame
* f
)
496 SetConsoleCursorPosition (cur_screen
, cursor_coords
);
499 /***********************************************************************
501 ***********************************************************************/
504 sys_tputs (char *str
, int nlines
, int (*outfun
) (int))
509 sys_tgetstr (char *cap
, char **area
)
515 /***********************************************************************
517 ***********************************************************************/
519 struct tty_display_info
*current_tty
= NULL
;
535 cmcheckmagic (struct tty_display_info
*tty
)
540 cmcostinit (struct tty_display_info
*tty
)
545 cmgoto (struct tty_display_info
*tty
, int row
, int col
)
550 Wcm_clear (struct tty_display_info
*tty
)
555 /* Report the current cursor position. The following two functions
556 mirror cm.h macros and are used in term.c's tty menu code, so they
557 are not really "stubs". */
559 curX (struct tty_display_info
*tty
)
561 return cursor_coords
.X
;
565 curY (struct tty_display_info
*tty
)
567 return cursor_coords
.Y
;
570 /***********************************************************************
572 ***********************************************************************/
575 /* Turn appearances of face FACE_ID on tty frame F on. */
578 w32_face_attributes (struct frame
*f
, int face_id
)
581 struct face
*face
= FACE_FROM_ID (f
, face_id
);
583 eassert (face
!= NULL
);
585 char_attr
= char_attr_normal
;
587 /* Reverse the default color if requested. If background and
588 foreground are specified, then they have been reversed already. */
589 if (face
->tty_reverse_p
)
590 char_attr
= (char_attr
& 0xff00) + ((char_attr
& 0x000f) << 4)
591 + ((char_attr
& 0x00f0) >> 4);
593 /* Before the terminal is properly initialized, all colors map to 0.
594 Don't try to resolve them. */
595 if (NILP (Vtty_defined_color_alist
))
598 /* Colors should be in the range 0...15 unless they are one of
599 FACE_TTY_DEFAULT_COLOR, FACE_TTY_DEFAULT_FG_COLOR or
600 FACE_TTY_DEFAULT_BG_COLOR. Other out of range colors are
601 invalid, so it is better to use the default color if they ever
602 get through to here. */
603 if (face
->foreground
>= 0 && face
->foreground
< 16)
604 char_attr
= (char_attr
& 0xfff0) + face
->foreground
;
606 if (face
->background
>= 0 && face
->background
< 16)
607 char_attr
= (char_attr
& 0xff0f) + (face
->background
<< 4);
613 initialize_w32_display (struct terminal
*term
, int *width
, int *height
)
615 CONSOLE_SCREEN_BUFFER_INFO info
;
616 Mouse_HLInfo
*hlinfo
;
618 term
->rif
= 0; /* No window based redisplay on the console. */
619 term
->cursor_to_hook
= w32con_move_cursor
;
620 term
->raw_cursor_to_hook
= w32con_move_cursor
;
621 term
->clear_to_end_hook
= w32con_clear_to_end
;
622 term
->clear_frame_hook
= w32con_clear_frame
;
623 term
->clear_end_of_line_hook
= w32con_clear_end_of_line
;
624 term
->ins_del_lines_hook
= w32con_ins_del_lines
;
625 term
->insert_glyphs_hook
= w32con_insert_glyphs
;
626 term
->write_glyphs_hook
= w32con_write_glyphs
;
627 term
->delete_glyphs_hook
= w32con_delete_glyphs
;
628 term
->ring_bell_hook
= w32_sys_ring_bell
;
629 term
->reset_terminal_modes_hook
= w32con_reset_terminal_modes
;
630 term
->set_terminal_modes_hook
= w32con_set_terminal_modes
;
631 term
->set_terminal_window_hook
= NULL
;
632 term
->update_begin_hook
= w32con_update_begin
;
633 term
->update_end_hook
= w32con_update_end
;
635 term
->read_socket_hook
= w32_console_read_socket
;
636 term
->mouse_position_hook
= w32_console_mouse_position
;
638 /* The following are not used on the console. */
639 term
->frame_rehighlight_hook
= 0;
640 term
->frame_raise_lower_hook
= 0;
641 term
->set_vertical_scroll_bar_hook
= 0;
642 term
->condemn_scroll_bars_hook
= 0;
643 term
->redeem_scroll_bar_hook
= 0;
644 term
->judge_scroll_bars_hook
= 0;
645 term
->frame_up_to_date_hook
= 0;
647 /* Initialize the mouse-highlight data. */
648 reset_mouse_highlight (&term
->display_info
.tty
->mouse_highlight
);
650 /* Initialize interrupt_handle. */
653 /* Remember original console settings. */
654 keyboard_handle
= GetStdHandle (STD_INPUT_HANDLE
);
655 GetConsoleMode (keyboard_handle
, &prev_console_mode
);
657 prev_screen
= GetStdHandle (STD_OUTPUT_HANDLE
);
659 #ifdef USE_SEPARATE_SCREEN
660 cur_screen
= CreateConsoleScreenBuffer (GENERIC_READ
| GENERIC_WRITE
,
662 CONSOLE_TEXTMODE_BUFFER
,
665 if (cur_screen
== INVALID_HANDLE_VALUE
)
667 printf ("CreateConsoleScreenBuffer failed in ResetTerm\n");
668 printf ("LastError = 0x%lx\n", GetLastError ());
673 cur_screen
= prev_screen
;
674 GetConsoleCursorInfo (prev_screen
, &prev_console_cursor
);
677 /* Respect setting of LINES and COLUMNS environment variables. */
679 char * lines
= getenv ("LINES");
680 char * columns
= getenv ("COLUMNS");
682 if (lines
!= NULL
&& columns
!= NULL
)
684 SMALL_RECT new_win_dims
;
687 new_size
.X
= atoi (columns
);
688 new_size
.Y
= atoi (lines
);
690 GetConsoleScreenBufferInfo (cur_screen
, &info
);
692 /* Shrink the window first, so the buffer dimensions can be
693 reduced if necessary. */
694 new_win_dims
.Top
= 0;
695 new_win_dims
.Left
= 0;
696 new_win_dims
.Bottom
= min (new_size
.Y
, info
.dwSize
.Y
) - 1;
697 new_win_dims
.Right
= min (new_size
.X
, info
.dwSize
.X
) - 1;
698 SetConsoleWindowInfo (cur_screen
, TRUE
, &new_win_dims
);
700 SetConsoleScreenBufferSize (cur_screen
, new_size
);
702 /* Set the window size to match the buffer dimension. */
703 new_win_dims
.Top
= 0;
704 new_win_dims
.Left
= 0;
705 new_win_dims
.Bottom
= new_size
.Y
- 1;
706 new_win_dims
.Right
= new_size
.X
- 1;
707 SetConsoleWindowInfo (cur_screen
, TRUE
, &new_win_dims
);
711 GetConsoleScreenBufferInfo (cur_screen
, &info
);
713 char_attr_normal
= info
.wAttributes
;
715 /* Determine if the info returned by GetConsoleScreenBufferInfo
716 is realistic. Old MS Telnet servers used to only fill out
717 the dwSize portion, even modern one fill the whole struct with
718 garbage when using non-MS telnet clients. */
719 if ((w32_use_full_screen_buffer
720 && (info
.dwSize
.Y
< 20 || info
.dwSize
.Y
> 100
721 || info
.dwSize
.X
< 40 || info
.dwSize
.X
> 200))
722 || (!w32_use_full_screen_buffer
723 && (info
.srWindow
.Bottom
- info
.srWindow
.Top
< 20
724 || info
.srWindow
.Bottom
- info
.srWindow
.Top
> 100
725 || info
.srWindow
.Right
- info
.srWindow
.Left
< 40
726 || info
.srWindow
.Right
- info
.srWindow
.Left
> 100)))
732 else if (w32_use_full_screen_buffer
)
734 *height
= info
.dwSize
.Y
; /* lines per page */
735 *width
= info
.dwSize
.X
; /* characters per line */
739 /* Lines per page. Use buffer coords instead of buffer size. */
740 *height
= 1 + info
.srWindow
.Bottom
- info
.srWindow
.Top
;
741 /* Characters per line. Use buffer coords instead of buffer size. */
742 *width
= 1 + info
.srWindow
.Right
- info
.srWindow
.Left
;
745 if (os_subtype
== OS_NT
)
746 w32_console_unicode_input
= 1;
748 w32_console_unicode_input
= 0;
750 /* This is needed by w32notify.c:send_notifications. */
751 dwMainThreadId
= GetCurrentThreadId ();
753 /* Setup w32_display_info structure for this frame. */
755 w32_initialize_display_info (build_string ("Console"));
760 DEFUN ("set-screen-color", Fset_screen_color
, Sset_screen_color
, 2, 2, 0,
761 doc
: /* Set screen foreground and background colors.
763 Arguments should be indices between 0 and 15, see w32console.el. */)
764 (Lisp_Object foreground
, Lisp_Object background
)
766 char_attr_normal
= XFASTINT (foreground
) + (XFASTINT (background
) << 4);
772 DEFUN ("get-screen-color", Fget_screen_color
, Sget_screen_color
, 0, 0, 0,
773 doc
: /* Get color indices of the current screen foreground and background.
775 The colors are returned as a list of 2 indices (FOREGROUND BACKGROUND).
776 See w32console.el and `tty-defined-color-alist' for mapping of indices
780 return Fcons (make_number (char_attr_normal
& 0x000f),
781 Fcons (make_number ((char_attr_normal
>> 4) & 0x000f), Qnil
));
784 DEFUN ("set-cursor-size", Fset_cursor_size
, Sset_cursor_size
, 1, 1, 0,
785 doc
: /* Set cursor size. */)
788 CONSOLE_CURSOR_INFO cci
;
789 cci
.dwSize
= XFASTINT (size
);
791 (void) SetConsoleCursorInfo (cur_screen
, &cci
);
797 syms_of_ntterm (void)
799 DEFVAR_BOOL ("w32-use-full-screen-buffer",
800 w32_use_full_screen_buffer
,
801 doc
: /* Non-nil means make terminal frames use the full screen buffer dimensions.
802 This is desirable when running Emacs over telnet.
803 A value of nil means use the current console window dimensions; this
804 may be preferable when working directly at the console with a large
805 scroll-back buffer. */);
806 w32_use_full_screen_buffer
= 0;
808 defsubr (&Sset_screen_color
);
809 defsubr (&Sget_screen_color
);
810 defsubr (&Sset_cursor_size
);