Increase speed on cygwin terminals

This commit is contained in:
Markus Gans 2016-11-20 21:15:43 +01:00
parent 082bbfbaa2
commit 5530c99d22
7 changed files with 34 additions and 33 deletions

View File

@ -1,4 +1,5 @@
2016-11-20 Markus Gans <guru.mail@muenster.de>
* Increase speed on cygwin terminals
* Improve tty settings
2016-11-13 Markus Gans <guru.mail@muenster.de>

View File

@ -647,7 +647,7 @@ void FButton::draw()
setColor (button_fg, button_bg);
for (x=0; x < i; x++)
print (space); // █
print (space); // █
if ( hotkeypos == -1 )
setCursorPos (1+margin+i+mono_1st_char, 1+j ); // first character

View File

@ -1310,6 +1310,8 @@ void FMenu::drawItems()
{
if ( isNewFont() )
print (fc::NF_Bullet); // NF_Bullet ●
else if ( isCygwinTerminal() )
print (0x04);
else
print (fc::Bullet); // Bullet ●
}

View File

@ -513,6 +513,14 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
if ( ! ( switchOn() || switchOff() || colorChange(term, next) ) )
return 0;
if ( cygwin_terminal && (term->fg_color > 7 || term->bg_color > 7) )
{
// reset blink and bold mode from colors > 7
char* rst = const_cast<char*>(CSI "m");
append_sequence (rst);
reset(term);
}
if ( hasNoAttribute(next) )
{
if ( off.pc_charset )
@ -607,7 +615,7 @@ char* FOptiAttr::changeAttribute (char_data*& term, char_data*& next)
setTermReverse(term);
if ( next->standout )
setTermStandout(term);
setTermStandout(term);
}
}
}
@ -1346,36 +1354,11 @@ void FOptiAttr::change_color (char_data*& term, char_data*& next)
short ansi_fg = vga2ansi(fg);
short ansi_bg = vga2ansi(bg);
if ( cygwin_terminal )
{
// reset blink and bold mode from colors > 7
char* rst = const_cast<char*>(CSI "m");
append_sequence (rst);
reset(term);
if ( term->fg_color != fg && (color_str = tparm(AF, ansi_fg)) )
append_sequence (color_str);
if ( ansi_fg != Default )
{
color_str = tparm(AF, ansi_fg);
if ( color_str )
append_sequence (color_str);
}
if ( ansi_bg != Default )
{
color_str = tparm(AB, ansi_bg);
if ( color_str )
append_sequence (color_str);
}
}
else
{
if ( term->fg_color != fg && (color_str = tparm(AF, ansi_fg)) )
append_sequence (color_str);
if ( term->bg_color != bg && (color_str = tparm(AB, ansi_bg)) )
append_sequence (color_str);
}
if ( term->bg_color != bg && (color_str = tparm(AB, ansi_bg)) )
append_sequence (color_str);
}
else if ( Sf && Sb )
{

View File

@ -72,7 +72,10 @@ void FRadioButton::drawRadioButton()
else
{
print ('(');
print (fc::Bullet); // Bullet ●
if ( isCygwinTerminal() )
print (0x04);
else
print (fc::Bullet); // Bullet ●
print (')');
}
}

View File

@ -2667,6 +2667,13 @@ void FTerm::init_termcaps()
tcap[fc::t_orig_pair].string = \
const_cast<char*>(CSI "39;49;25m");
// avoid dim + underline
tcap[fc::t_enter_dim_mode].string = 0;
tcap[fc::t_exit_dim_mode].string = 0;
tcap[fc::t_enter_underline_mode].string = 0;
tcap[fc::t_exit_underline_mode].string = 0;
FTermcap::attr_without_color = 18;
}
else if ( rxvt_terminal && ! urxvt_terminal )
{

View File

@ -213,6 +213,7 @@ Window::Window (FWidget* parent)
: FDialog(parent)
, windows()
{
FString drop_down_symbol;
// menu bar
FMenuBar* Menubar = new FMenuBar (this);
@ -221,7 +222,11 @@ Window::Window (FWidget* parent)
File->setStatusbarMessage ("File management commands");
// dialog list menu item
FString drop_down_symbol = wchar_t(fc::BlackDownPointingTriangle);
if ( isCygwinTerminal() )
drop_down_symbol = 'v';
else
drop_down_symbol = wchar_t(fc::BlackDownPointingTriangle);
FDialogListMenu* DglList = new FDialogListMenu (drop_down_symbol, Menubar);
DglList->setStatusbarMessage ("List of all the active dialogs");