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> 2016-11-20 Markus Gans <guru.mail@muenster.de>
* Increase speed on cygwin terminals
* Improve tty settings * Improve tty settings
2016-11-13 Markus Gans <guru.mail@muenster.de> 2016-11-13 Markus Gans <guru.mail@muenster.de>

View File

@ -1310,6 +1310,8 @@ void FMenu::drawItems()
{ {
if ( isNewFont() ) if ( isNewFont() )
print (fc::NF_Bullet); // NF_Bullet ● print (fc::NF_Bullet); // NF_Bullet ●
else if ( isCygwinTerminal() )
print (0x04);
else else
print (fc::Bullet); // Bullet ● 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) ) ) if ( ! ( switchOn() || switchOff() || colorChange(term, next) ) )
return 0; 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 ( hasNoAttribute(next) )
{ {
if ( off.pc_charset ) if ( off.pc_charset )
@ -1346,37 +1354,12 @@ void FOptiAttr::change_color (char_data*& term, char_data*& next)
short ansi_fg = vga2ansi(fg); short ansi_fg = vga2ansi(fg);
short ansi_bg = vga2ansi(bg); 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 ( 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)) ) if ( term->fg_color != fg && (color_str = tparm(AF, ansi_fg)) )
append_sequence (color_str); append_sequence (color_str);
if ( term->bg_color != bg && (color_str = tparm(AB, ansi_bg)) ) if ( term->bg_color != bg && (color_str = tparm(AB, ansi_bg)) )
append_sequence (color_str); append_sequence (color_str);
} }
}
else if ( Sf && Sb ) else if ( Sf && Sb )
{ {
if ( term->fg_color != fg && (color_str = tparm(Sf, fg)) ) if ( term->fg_color != fg && (color_str = tparm(Sf, fg)) )

View File

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

View File

@ -2667,6 +2667,13 @@ void FTerm::init_termcaps()
tcap[fc::t_orig_pair].string = \ tcap[fc::t_orig_pair].string = \
const_cast<char*>(CSI "39;49;25m"); 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 ) else if ( rxvt_terminal && ! urxvt_terminal )
{ {

View File

@ -213,6 +213,7 @@ Window::Window (FWidget* parent)
: FDialog(parent) : FDialog(parent)
, windows() , windows()
{ {
FString drop_down_symbol;
// menu bar // menu bar
FMenuBar* Menubar = new FMenuBar (this); FMenuBar* Menubar = new FMenuBar (this);
@ -221,7 +222,11 @@ Window::Window (FWidget* parent)
File->setStatusbarMessage ("File management commands"); File->setStatusbarMessage ("File management commands");
// dialog list menu item // 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); FDialogListMenu* DglList = new FDialogListMenu (drop_down_symbol, Menubar);
DglList->setStatusbarMessage ("List of all the active dialogs"); DglList->setStatusbarMessage ("List of all the active dialogs");