Add support for detecting and handling the screen-specific \ek\e\ escape sequence for setting the titlebar message in the prompt calculating code.

darcs-hash:20061114162125-ac50b-debe872f5916328f74a4560d0833b33f9eb89a40.gz
This commit is contained in:
axel 2006-11-15 02:21:25 +10:00
parent ab162c6c25
commit 4768b37531

View File

@ -186,6 +186,32 @@ static int calc_prompt_width( wchar_t *prompt )
found = 1;
}
}
if( !found )
{
wchar_t *term_name = env_get( L"TERM" );
if( term_name && wcscmp( term_name, L"screen" ) == 0 )
{
if( prompt[j+1] == L'k' )
{
wchar_t *end;
j+=2;
found = 1;
end = wcsstr( &prompt[j], L"\e\\" );
if( end )
{
j = (end-prompt)+1;
}
else
{
break;
}
}
}
}
}
else if( prompt[j] == L'\t' )
{