mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-17 11:01:14 -03:00
Redesign new environment variables to use env_var_t instead of wcstring
Migrate uses of empty() to missing() to distinguish between empty variable and unset variable
This commit is contained in:
@@ -606,8 +606,7 @@ int reader_interrupted()
|
||||
void reader_write_title()
|
||||
{
|
||||
const wchar_t *title;
|
||||
const wcstring term_str = env_get_string( L"TERM" );
|
||||
const wchar_t *term = term_str.empty()?NULL:term_str.c_str();
|
||||
const env_var_t term_str = env_get_string( L"TERM" );
|
||||
|
||||
/*
|
||||
This is a pretty lame heuristic for detecting terminals that do
|
||||
@@ -623,11 +622,10 @@ void reader_write_title()
|
||||
don't. Since we can't see the underlying terminal below screen
|
||||
there is no way to fix this.
|
||||
*/
|
||||
if ( !term )
|
||||
{
|
||||
if ( term_str.missing() )
|
||||
return;
|
||||
}
|
||||
|
||||
const wchar_t *term = term_str.c_str();
|
||||
bool recognized = false;
|
||||
recognized = recognized || contains( term, L"xterm", L"screen", L"nxterm", L"rxvt" );
|
||||
recognized = recognized || ! wcsncmp(term, L"xterm-", wcslen(L"xterm-"));
|
||||
|
||||
Reference in New Issue
Block a user