This is a weird edge case bug where the commands to scroll and control the pager stop immediately being sent and processed by less, and require the user to press [enter] after every command. For example, the user normally presses j to scroll one line down. When this bug occurs, the user sees the j printed at the bottom of the screen, and then must press [enter] for it to register.
This bug has something to do with leaving the terminal in a bad state, likely due to un-graceful exit under certain conditions. The issue doesn't happen consistently every time go doc invokes the pager, but it does happen with enough frequency to be incredibly annoying. Also once it does happen it appears to persist. However I have found that when it occurs, it can be fixed by re-invoking go doc io (for example), and allowing less to read the entire input buffer by scrolling to the bottom of the output using [shift]+G [enter] [enter] [enter] q [enter] once or twice. Sometimes if this doesn't fix it the first time, I repeat this but I alternate quitting via q [enter] and ctrl+c (SIGINT). Usually this somehow fixes the issue temporarily for a few more invocations of go doc. Perhaps it allows the terminal to get back to the correct state somehow (speculating).
The bug seems to be avoided when the output from go doc is fully and successfully piped to less. I think perhaps less sends either a SIGPIPE to go doc that crashes it and leaves less dangling (maybe?). This is something that requires further testing. It's possible that simply adding sigint handling to allow correct closing of the pipe and waiting for less to exit may address the issue.
This is a weird edge case bug where the commands to scroll and control the pager stop immediately being sent and processed by
less, and require the user to press[enter]after every command. For example, the user normally pressesjto scroll one line down. When this bug occurs, the user sees thejprinted at the bottom of the screen, and then must press[enter]for it to register.This bug has something to do with leaving the terminal in a bad state, likely due to un-graceful exit under certain conditions. The issue doesn't happen consistently every time
go docinvokes the pager, but it does happen with enough frequency to be incredibly annoying. Also once it does happen it appears to persist. However I have found that when it occurs, it can be fixed by re-invokinggo doc io(for example), and allowinglessto read the entire input buffer by scrolling to the bottom of the output using[shift]+G [enter] [enter] [enter] q [enter]once or twice. Sometimes if this doesn't fix it the first time, I repeat this but I alternate quitting viaq [enter]andctrl+c(SIGINT). Usually this somehow fixes the issue temporarily for a few more invocations ofgo doc. Perhaps it allows the terminal to get back to the correct state somehow (speculating).The bug seems to be avoided when the output from
go docis fully and successfully piped toless. I think perhapslesssends either aSIGPIPEtogo docthat crashes it and leaveslessdangling (maybe?). This is something that requires further testing. It's possible that simply adding sigint handling to allow correct closing of the pipe and waiting for less to exit may address the issue.