4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-03 10:47:44 +00:00

Use upstream whatsapp again (#809)

This commit is contained in:
Wim
2019-05-30 12:20:56 +02:00
committed by GitHub
parent 9619dff334
commit 3418e8c9af
89 changed files with 2145 additions and 1257 deletions

View File

@ -64,13 +64,15 @@ func Restore(fd int, state *State) error {
return windows.SetConsoleMode(windows.Handle(fd), state.mode)
}
// GetSize returns the dimensions of the given terminal.
// GetSize returns the visible dimensions of the given terminal.
//
// These dimensions don't include any scrollback buffer height.
func GetSize(fd int) (width, height int, err error) {
var info windows.ConsoleScreenBufferInfo
if err := windows.GetConsoleScreenBufferInfo(windows.Handle(fd), &info); err != nil {
return 0, 0, err
}
return int(info.Size.X), int(info.Size.Y), nil
return int(info.Window.Right - info.Window.Left + 1), int(info.Window.Bottom - info.Window.Top + 1), nil
}
// ReadPassword reads a line of input from a terminal without local echo. This