Skip to content

Commit

Permalink
set color/mono default pref based on main screen capability
Browse files Browse the repository at this point in the history
  • Loading branch information
cy384 committed Jun 5, 2021
1 parent 13a85e4 commit 79e05b3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ssheven.c
Expand Up @@ -169,6 +169,12 @@ int save_prefs(void)
return ok;
}

// check if the main device is black and white
int detect_color_screen(void)
{
return TestDeviceAttribute(GetMainDevice(), gdDevType);
}

void init_prefs(void)
{
// initialize everything to a safe default
Expand All @@ -189,7 +195,7 @@ void init_prefs(void)
prefs.privkey_path = "";
prefs.terminal_string = SSHEVEN_DEFAULT_TERM_STRING;
prefs.auth_type = USE_PASSWORD;
prefs.display_mode = COLOR;
prefs.display_mode = detect_color_screen() ? COLOR : FASTEST;
prefs.fg_color = blackColor;
prefs.bg_color = whiteColor;
prefs.font_size = 9;
Expand Down

0 comments on commit 79e05b3

Please sign in to comment.