aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.c
diff options
context:
space:
mode:
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;