Commit graph

83 commits

Author SHA1 Message Date
Charlie Gordon
b66bdb1206 tty: hide cursor during redisplay 2017-04-25 16:58:46 +00:00
Charlie Gordon
eacb2ad6e0 shell: major improvements in tty emulator
terminal emulator:
- add EditState.cols and EditState.rows: window dimensions in characters
- pass target window to new_shell_buffer()
- use window size for shell terminal emulator initial screen size
- set COLUMNS and LINES environment variables for child processes
- factorize emulator character output
- increase number of CSI arguments
- simplify and improve CSI m argument processing including
  multiple argument sequences
- minimal support for `:` as argument separator eg:
  \033[38;5;128:128:128m
- support erase line vt100 command:
  \033[K, \033[0K erase end of line
  \033[1K         erase beginning of line
  \033[2K         erase complete line
debugging:
- pass string argument to set-trace: on, off or list of trace indicators
- remove doctor command
- add QE_TRACE_EMULATE for emulator trace messages
- fix incorrect uses of eb_delete()
2017-04-21 14:44:14 +00:00
Charlie Gordon
c57a7c6233 display: small fixes for consistency
- add wrappers in display.h
- renamed tty dpy_xxx handlers for consistency
- separate tty_term_resize called on signal and tty_dpy_invalidate
- add dpy_xor_rectangle for software cursor, remove QECOLOR_XOR
2017-04-18 09:14:55 +00:00
Charlie Gordon
7b40bb4f3a display: improve automatic redisplay upon terminal window resize
- signal and detect asynchronous redisplay signal from SIGWINCH
2017-04-17 23:01:21 +00:00
Charlie Gordon
b39607410e fixed compilation warnings 2017-04-14 06:59:17 +00:00
Charlie Gordon
6c595c1f2c colors: extend color system
- add 8K color modes and 64-bit QETermStyle values
- add 64-bit buffer style support
- reduce colored character system used in syntax handlers to 8-bit style
  and 24-bit code point
- use QETermStyle type instead of int wherever a composite style is used
- force color system used by the terminal with environment variables:
  USE_16_COLORS=1, USE_256_COLORS=1 or USE_TRUE_COLORS=1
2017-04-12 07:33:20 +00:00
Charlie Gordon
5d463eb5ad styles: improve consistency
- rename font styles QE_STYLE_xxx to QE_FONT_STYLE_xxx
- rename font family QE_FAMILY_xxx to QE_FONT_FAMILY_xxx
- improve tests/16colors.pl: display bold italics combination
- improve tests/color-spaces.pl: compare true color and palette dumps
- add colortest target in Makefile to produce various color patterns
2017-04-11 06:46:13 +00:00
Charlie Gordon
799b1489bc display: full support for 256 color virtual terminal
- add various utilities for color escape sequence testing:
  tests/16colors.pl
  tests/256colors2.pl
  tests/color-spaces.pl
  tests/truecolors.sh
  tests/xterm-colortest.sh
  tests/xterm-colour-chart.py
- use colored code-points only for syntax highlighting
- use QETermStyle and QEStyleDef internally
- convert to TTYChar attributes only for text terminal output.
- remove most CHAR_MASK and STYLE_SHIFT handling
- pass QETermStyle array to get_colorized_line mode handlers
- pass QETermStyle array to isearch_colorize_matches
- remove combine_static_colorized_line
- move color matching functions to util.c
- rename get_tty_color as qe_map_color
- improve local variable naming consistency:
  DisplayState *ds, QEStyleDef *stp, QEStyleDef styledef.
2017-04-03 08:33:57 +00:00
Charlie Gordon
4104ab568b display: improve color and style handling
- add support for 256 and true color terminals
- fix color handling for defined styles
- fix bold, italic and underline handling for terminals
- use more explicit symbols for qe-term emulator in shell.c
- shell buffer terminal emulator still uses 16 colors
- display buffer style in C-X =
- bumped version to 0.5.0dev
2017-04-02 01:12:01 +00:00
Charlie Gordon
a63aff6f3e fixed compilation on stack Debian 2017-03-16 17:18:29 +00:00
Charlie Gordon
26fd39d9e0 unicode: improve support for wide and combining code points
- qe_isaccent() recognises all combining code points (to be refined)
- add computer generated width table unicode_width.h
- display difference in hex in compare-windows to distinguish
  space and nbsp, normal and combined form for accented letters.
- display multiple combining code points in what-cursor-position (C-x =)
- attach combining code points to preceeding space in display_char_bidir
- handle accents specificaaly in flush_fragment
- handle combining code-points in screen backstore via indirection table
  this transient table can be inspected via describe-screen
2017-03-16 09:16:31 +00:00
Charlie Gordon
ec07d5aec8 basic: charset improvements
- add QECharset.encode_table as a default for CharsetDecodeState.table
- make CharsetDecodeState.table const
- use static initializers for utf8 tables
- add al32utf8 charset name (used in Oracle for true utf-8 encoding)
- use direct pointers in unicode_glyph_range_index
- initialize unicode_glyph_range_index at run time
- rename unicode_glyph_tty_width as unicode_tty_glyph_width
- changed unihex display to space out single width characters
2017-03-15 23:42:23 +00:00
Charlie Gordon
38fdd559f5 display: improve display structure handling
- add QEDisplay.dpy_describe handler
- rename dpy_init as screen_init
- allocate TTYState instead of using static struct in tty.c
2017-03-15 07:24:31 +00:00
Charlie Gordon
d5e10dfe77 update copyrights, TODO list 2016-06-09 16:24:10 +00:00
Charlie Gordon
1f5a77a784 portability: stop defining symbols starting with __ 2015-09-16 22:18:22 +00:00
Charlie Gordon
fdaa11780f protect tty_resize against spurious window sizes 2015-09-16 12:35:01 +00:00
Charlie Gordon
bac5773927 tty: rearrange code 2015-08-17 18:13:50 +00:00
Charlie Gordon
65e16f7f82 tty: fixed non ASCII input from utf8 terminals 2015-08-14 15:56:28 +00:00
Charlie Gordon
f84a844a5e tty: improved support for OS/X iterm2
- added support for extended CSI sequences such as
  C-up    = ^[[1;5A
  C-down  = ^[[1;5B
  C-left  = ^[[1;5D
  C-right = ^[[1;5C
  S-left  = ^[[1;2D
  S-right = ^[[1;2C
2015-08-13 23:14:11 +00:00
Charlie Gordon
0efc7d9c56 commented casts 2015-06-19 21:39:07 +00:00
Charlie Gordon
5acb53ef0f fixed signed/unsigned inconsistency 2015-05-03 10:16:15 +00:00
Charlie Gordon
ebc8f89a82 prevent strict warnings 2014-05-27 22:59:48 +00:00
Charlie Gordon
d0e1447aa3 improve utf-8 support
* display non BMP code-points as utf-8 if not CONFIG_TINY
2014-05-14 17:40:53 +00:00
Charlie Gordon
90971b9861 improve c-mode
* add indent_func method in ModeDef
* make c-indent-region more general as indent-region
* add c-forward-conditional on M-]
* add c-backward-conditional on M-[
* add c-list-conditionals on M-i
* use trick to disambiguate M-[ and CSI sequences
* add eb_is_in_indentation(b, offset)
* fix c-mode indentation of case and default lines
2014-03-23 01:11:34 +00:00
Charlie Gordon
ee690b2895 add support for web protocols: ftp, http, https
* add wget-mode to retrieve web contents via find-file
* add shell flags for buffer mode change upon download completion
* fix do_electric_filename to keep http:// prefix and such
2014-03-19 19:42:30 +00:00
Charlie Gordon
48c14ba824 add support for combining marks (accents)
* add qe_isaccent() to test for combining marks
* add do_combine_char() command to insert or remove combining marks
* fix some display glitches involving combining marks
* add expand_ligature() and combine_accent() to handle simple ligatures
* change do_what_cursor_position() to display combining marks
2014-02-01 12:49:06 +00:00
Charlie Gordon
c5f56a0d5b Fix memory leaks and bad references detected by valgrind
* add free_font_cache()
* add css_free_colors()
* add unload_ligatures()
* add --free-all cmd line option to free memory upon exit for valgrind
* tty.c: fix off by 3 size in qe_realloc. Should be typed
* qe.c: fix invalid pointer reference upon destroying transient buffer
2014-01-24 00:46:26 +00:00
Charlie Gordon
e967914b5a improve consistency in new/delete methodology
* use qe_mallocz for all structures
* prevent spurious uses of malloc/free/realloc
* pass pointers to pointers to all deletion functions
* use consistent patterns for list deletions
* add more dependencies in Makefiles
2014-01-23 12:56:22 +00:00
Charlie Gordon
02da1bb7a1 add generic styles buffer from shell color mode
* styles_buffer hold static style info for each character in the buffer
* new buffer flags to create styles buffers with 1, 2 or 4 bytes per char
* copy static styles to the kill_ring and pasted them style enabled buffers
* preserve static styles in convert-buffer-file-coding-system
* display style bytes in bufed list
* add commands set-region-color, set-region-style, drop-styles
2014-01-15 19:44:24 +00:00
Charlie Gordon
5f12ffb390 prevent spurious cursor move when not found 2014-01-11 18:46:14 +00:00
Charlie Gordon
c91bd12b8f simplified editing modes
* added colorize_func in ModeDef struct
* removed mode_init functions for most language modes
* other small improvements in mode_probe functions
* no need for get_basename in mode_probe functions
2014-01-05 23:42:54 +00:00
Charlie Gordon
02dec8bf1a added generic utility function unicode_glyph_tty_width in charset.c
* moved and improved code from tty_term_glyph_width
2014-01-02 11:28:30 +00:00
Charlie Gordon
68b4ba44ab fix for C++ compile (needed for Haiku)
renamed private structure members to priv_data
added casts on assignents from void* (OK in C, not in C++)
2013-12-17 16:06:35 +00:00
Charlie Gordon
a10c10ecf1 hide local data 2008-04-23 15:30:33 +00:00
Charlie Gordon
3ac1bd5aa0 use proper format in fscanf 2008-04-20 11:55:49 +00:00
Charlie Gordon
58b5872c52 fixed OpenBSD compile issues:
- check OpenBSD as uname output
- no longer use strcpy, strcat, sprintf
- added CONFIG_PTSNAME to disable Unix98 API under BSD
- fixed crash bug in tty.c on empty window
2008-04-15 23:24:03 +00:00
Charlie Gordon
8a2ee13f81 further kludges for linedraw in cygwin 2008-04-14 00:42:32 +00:00
Charlie Gordon
08da1814c5 fixed some BSD build issues 2008-04-13 23:44:39 +00:00
Charlie Gordon
85d121989e fixed some more tty color issues.
use tty.term_flags for emulation flags
improved cygwin tests
do not use V220 escapes to reset bold and blink
reset char attributes in more places to avoid side effects
2008-04-12 19:26:05 +00:00
Charlie Gordon
fa7b29d311 use blink for high intensity background color 2008-04-12 12:40:23 +00:00
Charlie Gordon
7252dbb2da comment 2008-04-10 21:15:18 +00:00
Charlie Gordon
d3823e1bb1 fixed shell mode: use ptsname instead of ptsname_r
disabled 16 color modes in cygwin, some issues remain if shell is started
2008-04-09 16:51:30 +00:00
Charlie Gordon
0cb0552601 fixed 32/64 bit compilation issues 2008-04-09 16:27:15 +00:00
Charlie Gordon
7d088e15f9 handle upto 16 colors in console output and shell terminal
simulate xterm 256 colors in terminal
improved bold trick
2008-04-08 19:57:33 +00:00
Charlie Gordon
10c0e75827 improved and documented terminal synching with erase-to-end-of-line 2008-04-04 09:56:17 +00:00
Charlie Gordon
82ca364b60 made tty_term_glyph_width generic and faster
improved tty_term_flush:
 - separate handling of fgcolor and bgcolor changes
 - simplified line drawing kludge
 - cleaned up handling of missing glyph
2008-03-31 09:44:27 +00:00
Charlie Gordon
72e59be778 fixed crash bug on forward_block in text mode:
- renamed get_colorized_line() to generic_get_colorized_line
 - added get_non_colorized_line() for uncolored modes
 - renamed EditState::get_colorized_line_func to get_colorized_line
   make this function pointer always non NULL

fixed bug in global-set-key: current bindings could not be overloaded

better tty charset detection and handling:
 - always use utf8 when output is not a tty
 - allow override with -c CHARSET command line option
 - added state variable show-unicode to display non latin1 as \uXXXX
 - added command line argument -c CHARSET (--ttycharset) to specify the
   charset of the tty. tty charset is reported in *messages* buffer at startup
 - display unsupported glyphs as half-width or full-width question mark pairs

improved tty output: use kill_end_of_line escape sequence
2008-03-29 18:06:41 +00:00
Charlie Gordon
28397f424f moved input_methods to QEmacsState
qe_register_binding takes ModeDef* and returns status
cosmetic changes in QEDisplay API
added int dpy_init(QEditScreen *s, QEDisplay *dpy, int w, int h);
  copies *dpy (or dummy_dpy if NULL) to QEditScreen and calls method
simplified dpy_init methods and calls
inlined 5 more methods
moved dummy_dpy to display.c and simplified
simplified to_hex
simplified qe_colors array handling
2008-01-11 11:29:28 +00:00
Charlie Gordon
a5eae3ed92 bumped copyrights, some cosmetics 2008-01-08 16:37:54 +00:00
Charlie Gordon
4743fa1308 added remove_slash and append_slash path utilities
renamed canonize to canonicalize
added crude support for ~user -> /home/user
added win32 specific stuff in basename
added C-/ as an alias for C-_
some cosmetics, moved code
create files with mode 0644 in raw_save_buffer
untabified, removed redundant spaces
modified code generators to the same effect
2008-01-03 09:51:29 +00:00