1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00:00
elinks/src/terminal
Kalle Olavi Niemitalo b6dfdf86a6 Bug 885: Proper charset support in xterm window title
When ELinks runs in an X11 terminal emulator (e.g. xterm), or in GNU
Screen, it tries to update the title of the window to match the title
of the current document.  To do this, ELinks sends an "OSC 1 ; Pt BEL"
sequence to the terminal.  Unfortunately, xterm expects the Pt string
to be in the ISO-8859-1 charset, making it impossible to display e.g.
Cyrillic characters.  In xterm patch #210 (2006-03-12) however, there
is a menu item and a resource that can make xterm take the Pt string
in UTF-8 instead, allowing characters from all around the world.
The downside is that ELinks apparently cannot ask xterm whether the
setting is on or off; so add a terminal._template_.latin1_title option
to ELinks and let the user edit that instead.

Complete list of changes:

- Add the terminal._template_.latin1_title option.  But do not add
  that to the terminal options window because it's already rather
  crowded there.

- In set_window_title(), take a new codepage argument.  Use it to
  decode the title into Unicode characters, and remove only actual
  control characters.  For example, CP437 has graphical characters in
  the 0x80...0x9F range, so don't remove those, even though ISO-8859-1
  has control characters in the same range.  Likewise, don't
  misinterpret single bytes of UTF-8 characters as control characters.

- In set_window_title(), do not truncate the title to the width of the
  window.  The font is likely to be different and proportional anyway.
  But do truncate before 1024 bytes, an xterm limit.

- In struct itrm, add a title_codepage member to remember which
  charset the master said it was going to use in the terminal window
  title.  Initialize title_codepage in handle_trm(), update it in
  dispatch_special() if the master sends the new request
  TERM_FN_TITLE_CODEPAGE, and use it in most set_window_title() calls;
  but not in the one that sets $TERM as the title, because that string
  was not received from the master and should consist of ASCII
  characters only.

- In set_terminal_title(), convert the caller-provided title to
  ISO-8859-1 or UTF-8 if appropriate, and report the codepage to the
  slave with the new TERM_FN_TITLE_CODEPAGE request.  The conversion
  can run out of memory, so return a success/error flag, rather than
  void.  In display_window_title(), check this result and don't update
  caches on error.

- Add a NEWS entry for all of this.
2009-01-01 16:17:03 +00:00
..
color.c Doxygenate src/terminal/ 2007-07-27 18:33:33 +03:00
color.h Doxygenate src/terminal/ 2007-07-27 18:33:33 +03:00
draw.c Prevent internal errors when terminal width or height are very small 2007-09-14 11:49:03 +02:00
draw.h Trim trailing whitespaces. 2007-09-14 15:12:32 +02:00
event.c Add get_terminal_codepage(). 2009-01-01 16:16:17 +00:00
event.h Doxygenate src/terminal/ 2007-07-27 18:33:33 +03:00
hardio.c Doxygenate src/terminal/ 2007-07-27 18:33:33 +03:00
hardio.h Remove empty lines in start of header files 2005-11-15 11:33:27 +01:00
itrm.h Bug 885: Proper charset support in xterm window title 2009-01-01 16:17:03 +00:00
kbd.c Bug 885: Proper charset support in xterm window title 2009-01-01 16:17:03 +00:00
kbd.h Doxygenate src/terminal/ 2007-07-27 18:33:33 +03:00
key.inc Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
Makefile path_to_top -> top_builddir 2005-10-20 04:00:35 +02:00
mouse.c Doxygenate src/terminal/ 2007-07-27 18:33:33 +03:00
mouse.h terminal: Define separate structs for events passed via the interlink socket. 2006-08-06 20:02:39 +00:00
palette.inc Doxygen: Begin commands with @ not \. 2007-07-31 13:47:12 +03:00
screen.c Refer to bug 96 in a comment. 2007-09-03 21:02:58 +03:00
screen.h Doxygenate src/terminal/ 2007-07-27 18:33:33 +03:00
tab.c Doxygenate src/terminal/ 2007-07-27 18:33:33 +03:00
tab.h Move delayed_open to src/terminal/tab.c 2006-01-16 19:28:03 +00:00
terminal.c Bug 885: Proper charset support in xterm window title 2009-01-01 16:17:03 +00:00
terminal.h Bug 885: Proper charset support in xterm window title 2009-01-01 16:17:03 +00:00
TODO Initial commit of the HEAD branch of the ELinks CVS repository, as of 2005-09-15 15:58:31 +02:00
window.c Doxygenate src/terminal/ 2007-07-27 18:33:33 +03:00
window.h More doc comments about coordinates. 2007-08-29 09:57:18 +03:00