1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00
elinks/src/config
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
..
actions-edit.inc doc: cut-clipboard does not merely delete text from clipboard. 2007-02-11 23:34:44 +02:00
actions-main.inc New action: move-cursor-line-start. 2007-12-16 01:13:39 +02:00
actions-menu.inc Initial commit of the HEAD branch of the ELinks CVS repository, as of 2005-09-15 15:58:31 +02:00
cmdline.c Patch 2: Modifications to the remaining parts of ELinks 2008-11-01 22:20:25 +02:00
cmdline.h Declare element types of lists. 2007-07-26 22:47:23 +03:00
conf.c config: Fix the "include" command. 2008-02-03 20:28:27 +02:00
conf.h config: Reduce the interface offered to exmode. 2008-02-03 14:43:26 +02:00
dialogs.c Delete unused keybinding_dialog_list. 2007-07-26 22:45:19 +03:00
dialogs.h Remove empty lines in start of header files 2005-11-15 11:33:27 +01:00
home.c Win32: Put .elinks in Application Data if %HOME% is undefined. 2007-07-18 00:27:08 +03:00
home.h Remove empty lines in start of header files 2005-11-15 11:33:27 +01:00
kbdbind.c Patch 3: Further fixes including strcasestr and convert_to_lowercase 2008-11-01 22:32:43 +02:00
kbdbind.h Add KEYMAP_INVALID value for enum keymap_id and properly check for it 2008-01-27 18:50:29 +00:00
Makefile path_to_top -> top_builddir 2005-10-20 04:00:35 +02:00
options.c config: Access OPT_MUST_SAVE in the real option, not alias. 2008-02-03 20:27:56 +02:00
options.h config: Fix the "include" command. 2008-02-03 20:28:27 +02:00
options.inc Bug 885: Proper charset support in xterm window title 2009-01-01 16:17:03 +00:00
opttypes.c config: Count backslashed newlines in str_rd. 2008-02-10 14:30:26 +02:00
opttypes.h config: Fix the "include" command. 2008-02-03 20:28:27 +02:00
timer.c Make arrays of option change hooks const. 2007-01-27 19:00:47 +02:00
timer.h Remove empty lines in start of header files 2005-11-15 11:33:27 +01:00
urlhist.c Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
urlhist.h Remove empty lines in start of header files 2005-11-15 11:33:27 +01:00