1
1
mirror of https://github.com/walles/moar.git synced 2024-09-11 20:17:13 +03:00

Probe terminal colors on the alt screen

This may or may not prevent #190 and #191.
This commit is contained in:
Johan Walles 2024-01-19 22:27:23 +01:00
parent c7eaf9a879
commit 1249f08c10

View File

@ -140,6 +140,8 @@ func NewScreenWithMouseModeAndColorType(mouseMode MouseMode, terminalColorCount
return nil, fmt.Errorf("problem setting up TTY: %w", err)
}
screen.setAlternateScreenMode(true)
// Request to get terminal background color. Answer will be handled in our
// main loop.
//
@ -147,8 +149,6 @@ func NewScreenWithMouseModeAndColorType(mouseMode MouseMode, terminalColorCount
// https://stackoverflow.com/questions/2507337/how-to-determine-a-terminals-background-color
fmt.Println("\x1b]11;?\x07")
screen.setAlternateScreenMode(true)
if mouseMode == MouseModeAuto {
screen.enableMouseTracking(!terminalHasArrowKeysEmulation())
} else if mouseMode == MouseModeSelect {