mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
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
This commit is contained in:
parent
1e524fbc7a
commit
3969c1b453
1 changed files with 17 additions and 1 deletions
18
reader.c
18
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;
|
||||
|
|
Loading…
Reference in a new issue