You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Integrated terminal resets scroll position to top when emacs is closed #84145
bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesterminalGeneral terminal issues that don't fall under another labelverifiedVerification succeeded
Enable escape sequence logging and capture the entering emacs logs and exit emacs logs for both the case where it's fine and the case where the scroll is off.
Stacks look the same. Here _onScroll called with _ignoreNextScrollEvent === true:
`:
And with _ignoreNextScrollEvent === false:
It seems like a timing issue. Between the call to _innerRefresh which sets _ignoreNextScrollEvent = true and _scroll, someone else is setting _ignoreNextScrollEvent = false. Here's one possible call sequences I see opening emacs in the bad case (true/false is the value of _ignoreNextScrollEvent ):
And from the good case:
For what it's worth, I also currently see this more often in insiders (vs OSS)
I don't use emacs or something, just run some tests which output a lot of stuff, then hide and unhide terminal - after a couple of moments I am on top of terminal. Scrolling it with a scrollbar to the bottom doesn't bring me to the last line, so I press enter
Yeah, I have to press enter to get to the bottom of the terminal. I can confirm that this is an issue with Linux and Windows (I see this on both), so it doesn't appear to be specific to any OS. This also happens with both native and remote development, so it is not specific to remote development (which I use a lot). For me, it starts happening after about an hour of use, and then becomes really frequent (almost every time I open the terminal). Its causing me to form a habitual response to just always press enter when I open the terminal ☹️
The #87477 case seems to be a symptom of the TerminalPanel onDidChangeVisibility callback not triggering a setVisible call on the active terminal instance.
I'm also having this issue. When I toggle open the terminal on WSL and PowerShell, the terminal is scrolled to the top, even with all extensions disabled. I'm not using emacs - it happens reliably regardless of the type of content in the terminal. Just focusing on the terminal doesn't have this behavior, only toggling it does.
Update: for anyone looking for a temporary fix, I used the extension "multi-command" and set up a shortcut to scroll the terminal to the bottom when opening it. Since I needed to first focus the terminal after opening it, I had to set up two cases, toggling when it's closed and toggling when it's already open:
bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesterminalGeneral terminal issues that don't fall under another labelverifiedVerification succeeded
Activity
Tyriar commentedon Nov 8, 2019
Can't repro 🙁 some things that might help diagnose:
mjbvz commentedon Nov 8, 2019
Seems to happen most reliably when I run emacs as the git editor, but as the screenshot shows it can also happen for normal runs.
From debugging:
Normal case
scrollcalled withundefined_onScrollcalled twice with_ignoreNextScrollEvent == truescrollLinesnot called by_onScrollBugged case
scrollcalled withundefined_onScrollcalled with_ignoreNextScrollEvent == true_onScrollcalled again_ignoreNextScrollEvent == falsescrollLinescalled by_onScrollwith-3145Tyriar commentedon Nov 8, 2019
That's definitely the problem, could you get the stacktrace for both of those?
mjbvz commentedon Nov 8, 2019
Stacks look the same. Here
_onScrollcalled with_ignoreNextScrollEvent === true:`:
And with
_ignoreNextScrollEvent === false:It seems like a timing issue. Between the call to
_innerRefreshwhich sets_ignoreNextScrollEvent = trueand_scroll, someone else is setting_ignoreNextScrollEvent = false. Here's one possible call sequences I see opening emacs in the bad case (true/false is the value of_ignoreNextScrollEvent):And from the good case:
For what it's worth, I also currently see this more often in insiders (vs OSS)
Yanpas commentedon Nov 19, 2019
I don't use emacs or something, just run some tests which output a lot of stuff, then hide and unhide terminal - after a couple of moments I am on top of terminal. Scrolling it with a scrollbar to the bottom doesn't bring me to the last line, so I press enter
rianquinn commentedon Dec 15, 2019
Yeah, I have to press enter to get to the bottom of the terminal. I can confirm that this is an issue with Linux and Windows (I see this on both), so it doesn't appear to be specific to any OS. This also happens with both native and remote development, so it is not specific to remote development (which I use a lot). For me, it starts happening after about an hour of use, and then becomes really frequent (almost every time I open the terminal). Its causing me to form a habitual response to just always press enter when I open the terminal☹️
Tyriar commentedon Dec 27, 2019
Another repro: #87477
Olovan commentedon Jan 5, 2020
The #87477 case seems to be a symptom of the TerminalPanel onDidChangeVisibility callback not triggering a setVisible call on the active terminal instance.
vscode/src/vs/workbench/contrib/terminal/browser/terminalPanel.ts
Lines 98 to 114 in df48af1
The code to re-sync the the Terminal viewport and scrollbar is in the TerminalInstance setVisible method.
vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Lines 904 to 931 in df48af1
I'm not sure if it's the same issue as the Emacs variation of the bug.
Merge pull request #88098 from Olovan/master
jcsagrero commentedon Jan 25, 2020
I'm also having this issue. When I toggle open the terminal on WSL and PowerShell, the terminal is scrolled to the top, even with all extensions disabled. I'm not using emacs - it happens reliably regardless of the type of content in the terminal. Just focusing on the terminal doesn't have this behavior, only toggling it does.
jcsagrero commentedon Jan 25, 2020
Update: for anyone looking for a temporary fix, I used the extension "multi-command" and set up a shortcut to scroll the terminal to the bottom when opening it. Since I needed to first focus the terminal after opening it, I had to set up two cases, toggling when it's closed and toggling when it's already open:
` "multiCommand.commands": [
{
"command": "multiCommand.toggleTermClosed",
"sequence": [
"workbench.action.terminal.toggleTerminal",
"workbench.action.terminal.focus",
"workbench.action.terminal.scrollToBottom",
aeschli commentedon Jan 30, 2020
verified with steps from #87477