Improve the message displayed by the client when window is too small

pull/25/head
Vasile Popescu 4 years ago committed by Elis Popescu
parent e8c6caac80
commit 1646e00a12

@ -64,8 +64,8 @@ func (c *ttyShareClient) updateAndDecideStdoutMuted() {
if c.winSizes.thisH < c.winSizes.remoteH || c.winSizes.thisW < c.winSizes.remoteW { if c.winSizes.thisH < c.winSizes.remoteH || c.winSizes.thisW < c.winSizes.remoteW {
atomic.StoreUint32(&c.writeFlag, 0) atomic.StoreUint32(&c.writeFlag, 0)
clearScreen() clearScreen()
fmt.Printf("\r\n\nYour terminal window has to be bigger than %dx%d\r\nDetach with <%s>, resize your window, and reconect.\r\n", messageFormat := "\n\rYour window is smaller than the remote window. Please resize.\n\r\tRemote window: %dx%d \n\r\tYour window: %dx%d \n\r"
c.winSizes.remoteW, c.winSizes.remoteH, c.detachKeys) fmt.Printf(messageFormat, c.winSizes.remoteW, c.winSizes.remoteH, c.winSizes.thisW, c.winSizes.thisH)
} else { } else {
if atomic.LoadUint32(&c.writeFlag) == 0 { // clear the screen when changing back to "write" if atomic.LoadUint32(&c.writeFlag) == 0 { // clear the screen when changing back to "write"
// TODO: notify the remote side to "refresh" the content. // TODO: notify the remote side to "refresh" the content.

Loading…
Cancel
Save