1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-30 01:55:30 +00:00
elinks/src/osdep
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
..
beos Bug 1004: Use c_toupper in a few more places. 2008-11-01 22:32:43 +02:00
os2 Bug 885: Proper charset support in xterm window title 2009-01-01 16:17:03 +00:00
riscos Autogenerate .vimrc files and put the master in config/vimrc 2006-01-15 18:38:58 +01:00
unix terminal: Define separate structs for events passed via the interlink socket. 2006-08-06 20:02:39 +00:00
win32 Win32: Put .elinks in Application Data if %HOME% is undefined. 2007-07-18 00:27:08 +03:00
ascii.h Remove empty lines in start of header files 2005-11-15 11:33:27 +01:00
generic.h Debian bug 464384: fix cast warning in alignof 2008-02-09 00:24:45 +02:00
getifaddrs.c Use PF_* instead of AF_* as first parameter of socket(2). 2006-01-04 00:32:58 +01:00
getifaddrs.h Remove empty lines in start of header files 2005-11-15 11:33:27 +01:00
Makefile Sort Makefile conditionals 2006-01-14 10:41:58 +01:00
newwin.c Name the exec_on_terminal() fg values. 2007-07-15 23:46:18 +03:00
newwin.h Remove empty lines in start of header files 2005-11-15 11:33:27 +01:00
osdep.c Bug 885: Proper charset support in xterm window title 2009-01-01 16:17:03 +00:00
osdep.h Bug 885: Proper charset support in xterm window title 2009-01-01 16:17:03 +00:00
signals.c unblock_itrm(),block_itrm(): drop unused parameter fd. 2007-03-05 22:54:24 +01:00
signals.h Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
stat.h Complete the list of S_I* macros. 2006-01-10 23:59:14 +01:00
stub.c CONFIG_WIN32 -> CONFIG_OS_WIN32 2006-01-11 20:10:27 +01:00
stub.h Merge with git+ssh://pasky.or.cz/srv/git/elinks.git 2005-11-27 19:40:49 +00:00
sysname.c Remove now useless $Id: lines. 2005-10-21 09:14:07 +02:00
sysname.h Remove empty lines in start of header files 2005-11-15 11:33:27 +01:00
system.h CONFIG_BEOS -> CONFIG_OS_BEOS 2006-01-11 20:12:59 +01:00
types.h Debian bug 464384: fix OFF_T_FORMAT mismatches on amd64 2008-02-10 11:30:27 +02:00