New command line switch "--no-terminal-data-request"

This commit is contained in:
Markus Gans 2020-02-25 23:42:31 +01:00
parent ff6ff14793
commit e5902a6ee6
5 changed files with 65 additions and 51 deletions

View File

@ -1,3 +1,7 @@
2020-02-25 Markus Gans <guru.mail@muenster.de>
* New command line switch "--no-terminal-data-request" to disable
font and title determination
2020-02-19 Markus Gans <guru.mail@muenster.de>
* Some small code improvements
* SGRoptimizer improved

View File

@ -318,8 +318,10 @@ void FApplication::showParameterUsage()
<< " Disable mouse support\n"
<< " --no-optimized-cursor "
<< " Disable cursor optimization\n"
<< " --no-terminal-detection"
<< " --no-terminal-detection "
<< " Disable terminal detection\n"
<< " --no-terminal-data-request"
<< " Do not determine terminal font and title\n"
<< " --no-color-change "
<< " Do not redefine the color palette\n"
<< " --no-sgr-optimizer "
@ -334,7 +336,7 @@ void FApplication::showParameterUsage()
<< "FreeBSD console options:\n"
<< " --no-esc-for-alt-meta "
<< " Do not send a ESC prefix for the alt/meta key\n"
<< " --no-cursorstyle-change"
<< " --no-cursorstyle-change "
<< " Do not change the current cursor style\n"
#elif defined(__NetBSD__) || defined(__OpenBSD__)
<< "\n"
@ -418,6 +420,7 @@ void FApplication::cmd_options (const int& argc, char* argv[])
{C_STR("no-mouse"), no_argument, nullptr, 0 },
{C_STR("no-optimized-cursor"), no_argument, nullptr, 0 },
{C_STR("no-terminal-detection"), no_argument, nullptr, 0 },
{C_STR("no-terminal-data-request"), no_argument, nullptr, 0 },
{C_STR("no-color-change"), no_argument, nullptr, 0 },
{C_STR("no-sgr-optimizer"), no_argument, nullptr, 0 },
{C_STR("vgafont"), no_argument, nullptr, 0 },
@ -471,6 +474,9 @@ void FApplication::cmd_options (const int& argc, char* argv[])
if ( std::strcmp(long_options[idx].name, "no-terminal-detection") == 0 )
getStartOptions().terminal_detection = false;
if ( std::strcmp(long_options[idx].name, "no-terminal-data-request") == 0 )
getStartOptions().terminal_data_request = false;
if ( std::strcmp(long_options[idx].name, "no-color-change") == 0 )
getStartOptions().color_change = false;

View File

@ -38,6 +38,7 @@ FStartOptions::FStartOptions()
: cursor_optimisation{true}
, mouse_support{true}
, terminal_detection{true}
, terminal_data_request{true}
, color_change{true}
, sgr_optimizer{true}
, vgafont{false}

View File

@ -1846,6 +1846,9 @@ void FTerm::init_captureFontAndTitle()
{
// Save the used xterm font and window title
if ( ! FStartOptions::getFStartOptions().terminal_data_request )
return;
xterm->captureFontAndTitle();
const auto& font = xterm->getFont();
const auto& title = xterm->getTitle();

View File

@ -77,11 +77,11 @@ class FStartOptions final
uInt8 cursor_optimisation : 1;
uInt8 mouse_support : 1;
uInt8 terminal_detection : 1;
uInt8 terminal_data_request : 1;
uInt8 color_change : 1;
uInt8 sgr_optimizer : 1;
uInt8 vgafont : 1;
uInt8 newfont : 1;
uInt8 : 1; // padding bits
fc::encoding encoding;
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(UNIT_TEST)