)]}' { "commit": "fd5a52a5d8b7d9e40debc473d5799bfafb8c60db", "tree": "fa6b1b60351effb396b583424e6083d708ed7ada", "parents": [ "3c38914b08f12b27bff0ad2105b42ef4c65a9461" ], "author": { "name": "Derek Che", "email": "drc@yahoo-inc.com", "time": "Thu Dec 18 21:22:47 2014 -0800" }, "committer": { "name": "Adam Langley", "email": "agl@golang.org", "time": "Fri Dec 19 22:48:49 2014 +0000" }, "message": "ssh/terminal: fix SetSize when nothing on current line\n\nSetSize has a problem may cause the following ReadPassword setting\ntemporary prompt not working, when changing width the current\nSetSize will call clearAndRepaintLinePlusNPrevious which would\nprint an old prompt whatever the current line has, causing a following\nReadPassword with temporary prompt not printing the different prompt.\n\nWhen running code like this, the nt.SetSize prints a \"\u003e \" as\nprompt then the temporary \"Password: \" prompt would never show up.\n\n```go\n oldState, err :\u003d terminal.MakeRaw(int(os.Stdin.Fd()))\n width, height, _ \u003d terminal.GetSize(int(os.Stdin.Fd()))\n nt :\u003d terminal.NewTerminal(os.Stdin, \"\u003e \")\n nt.SetSize(width, height)\n password, err \u003d nt.ReadPassword(\"Password: \")\n```\n\nthe new test cases is to test SetSize with different terminal sizes,\neither shrinking or expanding, a following ReadPassword should get the\ncorrect temporary prompt.\n\nChange-Id: I33d13b2c732997c0c88670d53545b8c0048b94b6\nReviewed-on: https://go-review.googlesource.com/1861\nReviewed-by: Adam Langley \u003cagl@golang.org\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "965f0cfcf505cca6f83ee887150bf7b2197baf7f", "old_mode": 33188, "old_path": "terminal.go", "new_id": "741eeb13f0fccf23c87ffd33c2487033f748a276", "new_mode": 33188, "new_path": "terminal.go" }, { "type": "modify", "old_id": "6579801204e923256396f69e4deae1386a269cbd", "old_mode": 33188, "old_path": "terminal_test.go", "new_id": "a663fe41b7786b28e317bf9fd309f86e734a6d1c", "new_mode": 33188, "new_path": "terminal_test.go" } ] }