Allow output channel to stay in scroll position
I would be nice if the output window if you are not on the bottom of the scroll position to keep your current position when new output is added.
Sometimes you're trying to read through the output and something new gets pushed there and then the scroll goes instantly to the bottom
Because output channels is the only way for an extension to provide a window with some custom output, I think it's really essential to provide a way to tell an output channel at least not to scroll to the bottom.
Here is the real-world scenario we're having issues with in wallaby. A user is editing the code, we are creating the output where the relevant bit of information (last edited test) is the first displayed in the output. However, because the output is always scrolled to the bottom, the feature is not very usable.

Perhaps the export function createOutputChannel(name: string): OutputChannel; function could take an options object where one could disable the auto-scrolling?
//cc @jrieken
makes sense
Now the output will behave the same way the debug console does. If there is new output comming it will only auto scroll if the last line is revealed.
@isidorn Awesome, thanks!
Thanks!
The solution (Version 1.6.0-insider) doesn't seem to work for our scenario (see the GIF above). My guess is that it happens because we're clearing the output, not appending to it.
@isidorn Should I create a separate issue for output channels where the output is refreshed and not appended?
@ArtemGovorov yes, please do.
@isidorn Done: https://github.com/Microsoft/vscode/issues/12257
I'm running 1.9.0-insider c5df118575aebc2e28a4addd4d4a29b899a514c5 and I am not seeing the output pane autoscroll (if starting from being cleared) nor of the scroll position is set to the end.
Hi @eamodio I tried reproducing this and was unable, namely I wrote a vscode extension which writes to the output channel - for me it nicely autoscrolls to the end
If you can still reproduce this issue can you please create a new issue with a small sample for which this can been seen. And just ping me on the issue - thanks!
'use strict';
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';
// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {
// Use the console to output diagnostic information (console.log) and errors (console.error)
// This line of code will only be executed once when your extension is activated
console.log('Congratulations, your extension "ts-extension" is now active!');
// The command has been defined in the package.json file
// Now provide the implementation of the command with registerCommand
// The commandId parameter must match the command field in package.json
let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
// The code you place here will be executed every time your command is executed
const output = vscode.window.createOutputChannel('isidor');
output.show();
for (var i = 0; i < 100; i++) {
output.appendLine('hello');
}
// Display a message box to the user
vscode.window.showInformationMessage('Hello World!');
});
context.subscriptions.push(disposable);
}