aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2007-03-18 09:38:46 +1000
committerGravatar axel <axel@liljencrantz.se>2007-03-18 09:38:46 +1000
commit3969c1b453eb73a5ea0829edd317f0de163f6c96 (patch)
tree3466c50393331bc50d717a1d046023132ed342ac /reader.c
parent1e524fbc7a956ee94c1a75165f27dc72d7818fcd (diff)
Add a blacklist of console types that are known not to support terminal titles, even when in a virtual terminal
darcs-hash:20070317233846-ac50b-4030f863aefb96085368470b76ee9da146c04c96.gz
Diffstat (limited to 'reader.c')
-rw-r--r--reader.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/reader.c b/reader.c
index bfa51a3a..996da8cf 100644
--- a/reader.c
+++ b/reader.c
@@ -538,13 +538,29 @@ void reader_write_title()
This is a pretty lame heuristic for detecting terminals that do
not support setting the title. If we recognise the terminal name
as that of a virtual terminal, we assume it supports setting the
- title. Otherwise we check the ttyname.
+ title. If we recognise it as that of a console, we assume it
+ does not support setting the title. Otherwise we check the
+ ttyname and see if we belive it is a virtual terminal.
+
+ One situation in which this breaks down is with screen, since
+ screen supports setting the terminal title if the underlying
+ terminal does so, but will print garbage on terminals that
+ don't. Since we can't see the underlying terminal below screen
+ there is no way to fix this.
*/
if( !term || !contains_str( term, L"xterm", L"screen", L"nxterm", L"rxvt", (wchar_t *)0 ) )
{
char *n = ttyname( STDIN_FILENO );
+
+ if( contains_str( term, L"linux" ) )
+ {
+ return;
+ }
+
if( strstr( n, "tty" ) || strstr( n, "/vc/") )
return;
+
+
}
title = function_exists( L"fish_title" )?L"fish_title":DEFAULT_TITLE;