[windows] exit if we can't get ConsoleHandles #2244

pull/2250/head
nick black 3 years ago
parent 5177773949
commit e8df81ebef
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -501,6 +501,11 @@ static int
apply_term_heuristics(tinfo* ti, const char* termname, queried_terminals_e qterm,
size_t* tablelen, size_t* tableused, bool* invertsixel,
unsigned nonewfonts){
#ifdef __MINGW64__
if(qterm == TERMINAL_UNKNOWN){
qterm = TERMINAL_MSTERMINAL;
}
#endif
if(!termname){
// setupterm interprets a missing/empty TERM variable as the special value “unknown”.
termname = ti->termname ? ti->termname : "unknown";
@ -596,6 +601,9 @@ apply_term_heuristics(tinfo* ti, const char* termname, queried_terminals_e qterm
*invertsixel = true;
}
ti->bce = true;
}else if(qterm == TERMINAL_MSTERMINAL){
ti->termname = "Windows Terminal";
ti->caps.rgb = true;
}else if(qterm == TERMINAL_CONTOUR){
termname = "Contour";
ti->caps.quadrants = true;
@ -744,11 +752,11 @@ int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out, unsigned ut
if(termtype){
logwarn("termtype (%s) ignored on windows\n", termtype);
}
if(prepare_windows_terminal(ti, &tablelen, &tableused) == 0){
ti->qterm = TERMINAL_MSTERMINAL;
if(cursor_y && cursor_x){
locate_cursor(ti, cursor_y, cursor_x);
}
if(prepare_windows_terminal(ti, &tablelen, &tableused)){
return -1;
}
if(cursor_y && cursor_x){
locate_cursor(ti, cursor_y, cursor_x);
}
#elif defined(__linux__)
ti->linux_fb_fd = -1;

@ -87,8 +87,7 @@ int prepare_windows_terminal(tinfo* ti, size_t* tablelen, size_t* tableused){
logerror("couldn't set output console mode\n");
return -1;
}
ti->termname = "Windows Terminal";
loginfo("verified Windows Terminal\n");
loginfo("verified Windows ConPTY\n");
return 0;
}
#endif

Loading…
Cancel
Save