jiebi/CodeConvo huggingface dataset:
Code change:
VSCode Version: Code - Insiders 1.11.0-insider (, 2017-03-17T08:14:15.805Z) OS Version: Windows_NT ia32 10.0. Extensions: ; Steps to Reproduce: a terminal and run "bash" with a text file containing some lines of text ctrl+v (or right-click) to paste some lines of text What's expected: The text should be appended before the cursor, and the existing text should be there after the cursor. What happens: Existing text disappears, and it seems some extra newlines are when pasting text. Note: there is no such problem when doing the exact same steps with This happens on insider builds, no idea if it happens with standard builds as well.
More information. Here is what happens when I try to paste this text function startagent { echo "Initialising new SSH agent..." /usr/bin/ssh-agent | sed 's/^echo/#echo/' "${SSHENV}" echo succeeded chmod 600 "${SSHENV}" . "${SSHENV}" /dev/null /usr/bin/ssh-add; } In the middle of a file containing this text: existing file with some text Here is what happens with (that's what expected: text is pasted in between existing text): ! Here is what happens with VSCode: text is pasted with extra newlines plus existing text appears in the middle of the pasted text !
Any update on this bug ?
Thanks for the ping. I've validated it's definitely an upstream issue. I tried to fix it a couple of days ago but didn't get anywhere. I'd guess it's related to node-pty or winpty as different shells appeared to handle it differently. It also seemed somewhat inconsistent. No plans to invest further in fixing it just yet.
This is probably a bug with VSCode's JS xterm module, not a node-pty or winpty bug. I placed these two lines in an untitled editor window: I then set the environment variable , started VSCode, and copy-and-pasted the two lines above into VSCode's integrated terminal. This appeared in the winpty trace: The clipboard has CRLF-delimited lines, because we're on Windows. However, in the VT/100 input format, CR means Return, and LF means Ctrl-Return. Something (probably the JS xterm) is copying the clipboard contents into the pty, and that something should normalize LF and CRLF into CR. I described this bug in detail the last time I saw it:
thanks! This is likely the culprit then which replaces all end of line chars with on Windows:
Yeah, I think your change will fix the issue. The function looks like it might also need a change. Maybe something like this?
FYI I think you may have run into these issues before? It would be a good idea to test these changes in in tomorrow's Insiders build.
I've certainly experienced aspects of this issue from the Python extension when running selections of code in the terminal.
I was unable to reproduce the problem anyway, so have no way of testing this. But thanks for letting me know :-)

Related discussion:
text: } public sendText(text: string, addNewLine: boolean): void { <del> if (addNewLine && text.substr(text.length - os.EOL.length) !== os.EOL) { text += os.EOL; </del> <ins> text = this._sanitizeInput(text); if (addNewLine && text.substr(text.length - 1) !== 'r') { text += 'r'; </ins> } this._process.send({ event: 'input',
Code change:
VSCode Version: Code - Insiders 1.11.0-insider (, 2017-03-17T08:14:15.805Z) OS Version: Windows_NT ia32 10.0. Extensions: ; Steps to Reproduce: a terminal and run "bash" with a text file containing some lines of text ctrl+v (or right-click) to paste some lines of text What's expected: The text should be appended before the cursor, and the existing text should be there after the cursor. What happens: Existing text disappears, and it seems some extra newlines are when pasting text. Note: there is no such problem when doing the exact same steps with This happens on insider builds, no idea if it happens with standard builds as well.
More information. Here is what happens when I try to paste this text function startagent { echo "Initialising new SSH agent..." /usr/bin/ssh-agent | sed 's/^echo/#echo/' "${SSHENV}" echo succeeded chmod 600 "${SSHENV}" . "${SSHENV}" /dev/null /usr/bin/ssh-add; } In the middle of a file containing this text: existing file with some text Here is what happens with (that's what expected: text is pasted in between existing text): ! Here is what happens with VSCode: text is pasted with extra newlines plus existing text appears in the middle of the pasted text !
Any update on this bug ?
Thanks for the ping. I've validated it's definitely an upstream issue. I tried to fix it a couple of days ago but didn't get anywhere. I'd guess it's related to node-pty or winpty as different shells appeared to handle it differently. It also seemed somewhat inconsistent. No plans to invest further in fixing it just yet.
This is probably a bug with VSCode's JS xterm module, not a node-pty or winpty bug. I placed these two lines in an untitled editor window: I then set the environment variable , started VSCode, and copy-and-pasted the two lines above into VSCode's integrated terminal. This appeared in the winpty trace: The clipboard has CRLF-delimited lines, because we're on Windows. However, in the VT/100 input format, CR means Return, and LF means Ctrl-Return. Something (probably the JS xterm) is copying the clipboard contents into the pty, and that something should normalize LF and CRLF into CR. I described this bug in detail the last time I saw it:
thanks! This is likely the culprit then which replaces all end of line chars with on Windows:
Yeah, I think your change will fix the issue. The function looks like it might also need a change. Maybe something like this?
FYI I think you may have run into these issues before? It would be a good idea to test these changes in in tomorrow's Insiders build.
I've certainly experienced aspects of this issue from the Python extension when running selections of code in the terminal.
I was unable to reproduce the problem anyway, so have no way of testing this. But thanks for letting me know :-)

Related discussion:
text: } private _sanitizeInput(data: any) { <del> return typeof data === 'string' ? data.replace(TerminalInstance.EOL_REGEX, os.EOL) : data; </del> <ins> return typeof data === 'string' ? data.replace(TerminalInstance.WINDOWS_EOL_REGEX, 'r') : data; </ins> } protected _getCwd(shell: IShellLaunchConfig, workspace: IWorkspace): string {
Code change:
Variable substitutions that are available for (see ) do not include currently selected text. I am looking for something similar to $(CurText) that is available in Visual Studio Arguments for External Tools (see ). Please add a variable ${curtext} which would be replaced with the currently selected text in the editor window. If no selection is available, it could use the current line at cursor position.
Nice idea, but I think it's too late for implement that in the current milestone...
Fixed by in
Verifiers: what happens if all text in a 300 MB file is selected...
good point. Maybe we should put a limit on this. Or only to copy the howl line at most (even though the line could also be 300mb I am fine with that) thoughts?
Selecting lots of text, at some point I get . If there's a predictable limit where this will fail, we should just cut the string off there. Unless only sending part of the text could be dangerous or unexpected for the user. In any case I think that sending multiple lines of text could be useful.
there is not a predictable limit since the variables are used in different scenarios. If somebody has an idea for a limit I am open to PRs

Related discussion:
text: return ''; } <ins> private get selectedText(): string { const activeEditor = this.editorService.getActiveEditor(); if (activeEditor) { const editorControl = (<ICodeEditor>activeEditor.getControl()); if (editorControl) { const editorModel = editorControl.getModel(); const editorSelection = editorControl.getSelection(); if (editorModel && editorSelection) { return editorModel.getValueInRange(editorSelection); } } } return ''; } </ins> private getFilePath(): string { let input = this.editorService.getActiveEditorInput(); if (input instanceof DiffEditorInput) {
Code change:
Variable substitutions that are available for (see ) do not include currently selected text. I am looking for something similar to $(CurText) that is available in Visual Studio Arguments for External Tools (see ). Please add a variable ${curtext} which would be replaced with the currently selected text in the editor window. If no selection is available, it could use the current line at cursor position.
Nice idea, but I think it's too late for implement that in the current milestone...
Fixed by in
Verifiers: what happens if all text in a 300 MB file is selected...
good point. Maybe we should put a limit on this. Or only to copy the howl line at most (even though the line could also be 300mb I am fine with that) thoughts?
Selecting lots of text, at some point I get . If there's a predictable limit where this will fail, we should just cut the string off there. Unless only sending part of the text could be dangerous or unexpected for the user. In any case I think that sending multiple lines of text could be useful.
there is not a predictable limit since the variables are used in different scenarios. If somebody has an idea for a limit I am open to PRs

Related discussion:
text: assert.strictEqual(configurationResolverService.resolve(workspace, 'abc ${lineNumber} xyz'), `abc ${editorService.mockLineNumber} xyz`); }); <ins> test('current selected text', () => { assert.strictEqual(configurationResolverService.resolve(workspace, 'abc ${selectedText} xyz'), `abc ${editorService.mockSelectedText} xyz`); }); </ins> test('substitute many', () => { if (platform.isWindows) { assert.strictEqual(configurationResolverService.resolve(workspace, '${workspaceFolder} - ${workspaceFolder}'), 'VSCodeworkspaceLocation - VSCodeworkspaceLocation');
Code change:
Variable substitutions that are available for (see ) do not include currently selected text. I am looking for something similar to $(CurText) that is available in Visual Studio Arguments for External Tools (see ). Please add a variable ${curtext} which would be replaced with the currently selected text in the editor window. If no selection is available, it could use the current line at cursor position.
Nice idea, but I think it's too late for implement that in the current milestone...
Fixed by in
Verifiers: what happens if all text in a 300 MB file is selected...
good point. Maybe we should put a limit on this. Or only to copy the howl line at most (even though the line could also be 300mb I am fine with that) thoughts?
Selecting lots of text, at some point I get . If there's a predictable limit where this will fail, we should just cut the string off there. Unless only sending part of the text could be dangerous or unexpected for the user. In any case I think that sending multiple lines of text could be useful.
there is not a predictable limit since the variables are used in different scenarios. If somebody has an idea for a limit I am open to PRs

Related discussion:
text: public activeEditorOptions: IEditorOptions; public activeEditorPosition: Position; public mockLineNumber: number; <ins> public mockSelectedText: string; </ins> private callback: (method: string) => void; constructor(callback?: (method: string) => void) { this.callback = callback || ((s: string) => { }); this.mockLineNumber = 15; <ins> this.mockSelectedText = 'selected text'; </ins> } public openEditors(inputs: any[]): Promise {
Code change:
Variable substitutions that are available for (see ) do not include currently selected text. I am looking for something similar to $(CurText) that is available in Visual Studio Arguments for External Tools (see ). Please add a variable ${curtext} which would be replaced with the currently selected text in the editor window. If no selection is available, it could use the current line at cursor position.
Nice idea, but I think it's too late for implement that in the current milestone...
Fixed by in
Verifiers: what happens if all text in a 300 MB file is selected...
good point. Maybe we should put a limit on this. Or only to copy the howl line at most (even though the line could also be 300mb I am fine with that) thoughts?
Selecting lots of text, at some point I get . If there's a predictable limit where this will fail, we should just cut the string off there. Unless only sending part of the text could be dangerous or unexpected for the user. In any case I think that sending multiple lines of text could be useful.
there is not a predictable limit since the variables are used in different scenarios. If somebody has an idea for a limit I am open to PRs

Related discussion:
text: getId: () => { return null; }, getControl: () => { return { <del> getSelection: () => { return { positionLineNumber: this.mockLineNumber }; } </del> <ins> getSelection: () => { return { positionLineNumber: this.mockLineNumber }; }, getModel: () => { return { getValueInRange: () => this.mockSelectedText }; } </ins> }; }, focus: () => { },
Code change:
Platforms Tested: Insiders 5-30 Code 1.11.1 Stable Windows 7 OS X Sierra (should be all platforms) Problem: Output panel drop-down does not track current active output if output channel is activated later , typically when an extension output Channel is active (eg Git). Output select box will show the default 0 index output (Tasks) Steps to reproduce: Open code with git repository/workspace select Git output Channel close code reopen code Git output will be active but drop-down shows Tasks Fixed with PR always update active select box selection with setOptions call on any output channel update Tested on Windows 7, OS X
Fixed via

Related discussion:
text: ) { super(null, action, [], 0); <del> this.toDispose.push(this.outputService.onOutputChannel(() => this.setOptions(this.getOptions(), this.getSelected(undefined)))); </del> <ins> this.toDispose.push(this.outputService.onOutputChannel(() => { const activeChannelIndex = this.getSelected(this.outputService.getActiveChannel().id); this.setOptions(this.getOptions(), activeChannelIndex); })); </ins> this.toDispose.push(this.outputService.onActiveOutputChannel(activeChannelId => this.setOptions(this.getOptions(), this.getSelected(activeChannelId)))); this.toDispose.push(attachSelectBoxStyler(this.selectBox, themeService));
Code change:
Testing Steps to Reproduce: integrated terminal and open the find widget the integrated terminal area very skinny bug The find widget starts overflowing into the explorer area: <img width="420" alt="screen shot 2017-06-28 at 1 25 51 pm" src="https://user-"
After , no more overflow but we now clip the find box: !
I guess we want it to be tiny like in the editor: <img width="221" alt="screen shot 2017-07-07 at 3 02 45 pm" src="https://user-"

Related discussion:
text: display: flex; padding: 4px; align-items: center; <ins> width: 220px; max-width: calc(100% - 28px - 28px - 8px); </ins> -webkit-transition: top 200ms linear; -o-transition: top 200ms linear;
Code change:
Testing Steps to Reproduce: integrated terminal and open the find widget the integrated terminal area very skinny bug The find widget starts overflowing into the explorer area: <img width="420" alt="screen shot 2017-06-28 at 1 25 51 pm" src="https://user-"
After , no more overflow but we now clip the find box: !
I guess we want it to be tiny like in the editor: <img width="221" alt="screen shot 2017-07-07 at 3 02 45 pm" src="https://user-"

Related discussion:
text: top: 0; } <ins> .monaco-workbench .simple-find-part .monaco-findInput { flex: 1; } </ins> /* Temporarily we don't show match numbers */ .monaco-workbench .simple-find-part .monaco-findInput .controls { display: none;
Code change:
Testing Steps to Reproduce: integrated terminal and open the find widget the integrated terminal area very skinny bug The find widget starts overflowing into the explorer area: <img width="420" alt="screen shot 2017-06-28 at 1 25 51 pm" src="https://user-"
After , no more overflow but we now clip the find box: !
I guess we want it to be tiny like in the editor: <img width="221" alt="screen shot 2017-07-07 at 3 02 45 pm" src="https://user-"

Related discussion:
text: ) { super(); this._findInput = this._register(new FindInput(null, this._contextViewService, { <del> width: 155, </del> label: NLS_FIND_INPUT_LABEL, placeholder: NLS_FIND_INPUT_", }));
Code change:
Would be great to see a tooltip on links, showing the target. Or popping it up in the status bar or elsewhere, like Chrome.
: Could you please explain the preview functionality bit more with screenshots of Chrome? I am new to open source community and this project. I use vscode often and would love to work on this if someone can guide me a little.
Lower left corner of the Chrome window when I hover the link to your name: ! But I think a normal tooltip would be easier.
Ah yes. I understand what you are talking about now. To verify, where the link is leading to. Seems like a beginner friendly feature. I can pick it up this weekend if anyone can nudge me towards the right direction. :)
Sorry for the delayed response. It seems that tooltips are only shown if the element has a attribute, but not for links that only have a . I wasn't able to find if there is an electron setting to enable tooltips for links without . I think we may have to implement this ourselves. To get started, take a look at this PR that a similar feature to another electron app: Here's where our webview code lives: I believe you should be able to attach a handler to the webview handler. Please let me know if you have any questions about the code or want to discuss potential designs
I m happy to receive help! :) I was facing issues while trying to build and fiddle around with the source code. Will definitely look into this PR and the code you pointed out this weekend. Thanks for taking your time to post this info. I ll post any questions or designs which I have.
Hi , I will create a PR to add attribute to every .
For verification: this was implemented as tooltip when you hover over links in a webview

Related discussion:
text: const text = data.contents.join('n'); const newDocument = new DOMParser().parseFromString(text, 'text/html'); <ins> newDocument.querySelectorAll('a').forEach(a => { if (!a.title) { a.title = a.href; } }); </ins> // set base-url if applicable if (initData.baseUrl && newDocument.head.getElementsByTagName('base').length === 0) { const baseElement = newDocument.createElement('base');
Code change:
<!-- Do you have a question? Please ask it on --<!-- Use Help Report Issues to prefill these. --- VSCode Version: latest OS Version: Win10 A little bit more space between last line from terminal and the blue line below would be nice !
I 1px border on the bottom would be fine, opening to PRs. Who ever wants to pick this up, you need to make sure the size of the terminal is calculated correctly given the new margin. Relevant files: , .
I'll pick this up. pretty much all of the other terminal issues are already taken, or out of my realm. just let me know somebody's not already working on this ;-)
sounds good
PR posted

Related discussion:
text: position: absolute; bottom: 0; top: 0; <ins> padding-bottom: 2px; </ins> } .monaco-workbench .panel.integrated-terminal .xterm a:not(.xterm-invalid-link) {
Code change:
<!-- Do you have a question? Please ask it on --<!-- Use Help Report Issues to prefill these. --- VSCode Version: latest OS Version: Win10 A little bit more space between last line from terminal and the blue line below would be nice !
I 1px border on the bottom would be fine, opening to PRs. Who ever wants to pick this up, you need to make sure the size of the terminal is calculated correctly given the new margin. Relevant files: , .
I'll pick this up. pretty much all of the other terminal issues are already taken, or out of my realm. just let me know somebody's not already working on this ;-)
sounds good
PR posted

Related discussion:
text: } const padding = parseInt(getComputedStyle(document.querySelector('.terminal-outer-container')).paddingLeft.split('px')[0], 10); <ins> const paddingBottom = parseInt(getComputedStyle(document.querySelector('.terminal-wrapper.active')).paddingBottom.split('px')[0], 10); </ins> // Use left padding as right padding, right padding is not defined in CSS just in case // xterm.js causes an unexpected overflow. const innerWidth = width - padding * 2; <del> TerminalInstance._lastKnownDimensions = new Dimension(innerWidth, height); </del> <ins> const innerHeight = height - paddingBottom; TerminalInstance._lastKnownDimensions = new Dimension(innerWidth, innerHeight); </ins> return TerminalInstance._lastKnownDimensions; }
Code change:
FYI I commented out the test. Please fix it and enable it.
The test is failing because the DOM is no longer filled with nodes so these tests can't work the way they did previously. Is it possible with Spectron to pull a DOM node object, including any custom properties it has? If so I could attach a reference to the object to the terminal element which would allow querying the terminal for this sort of information really easily.
Yes, you can access the DOM in Spectron and we do it in multiple places. For example refer to . This will allow you to execute java script code on the renderer process that has access to DOM and let you return the model you want. But please be aware that, Since it runs in a different process than the test process, console log does not work.
PR with fix is out , will merge in after release is branched off.

Related discussion:
text: dom.addClass(this._wrapperElement, 'terminal-wrapper'); this._xtermElement = document.createElement('div'); <ins> // Attach the xterm object to the DOM, exposing it to the smoke tests (<any>this._wrapperElement).xterm = this._xterm; </ins> this._xterm.open(this._xtermElement); this._xterm.attachCustomKeyEventHandler((event: KeyboardEvent) => { // Disable all input if the terminal is exiting
Code change:
FYI I commented out the test. Please fix it and enable it.
The test is failing because the DOM is no longer filled with nodes so these tests can't work the way they did previously. Is it possible with Spectron to pull a DOM node object, including any custom properties it has? If so I could attach a reference to the object to the terminal element which would allow querying the terminal for this sort of information really easily.
Yes, you can access the DOM in Spectron and we do it in multiple places. For example refer to . This will allow you to execute java script code on the renderer process that has access to DOM and let you return the model you want. But please be aware that, Since it runs in a different process than the test process, console log does not work.
PR with fix is out , will merge in after release is branched off.

Related discussion:
text: import { SpectronApplication } from '../../spectron/application'; <del> export class Terminal { static TERMINAL_SELECTOR = '.panel.integrated-terminal'; static TERMINAL_ROWS_SELECTOR = `${Terminal.TERMINAL_SELECTOR} .xterm-rows > div`; static TERMINAL_CURSOR = `${Terminal.TERMINAL_SELECTOR} .terminal-cursor`; </del> <ins> const PANEL_SELECTOR = 'div[id="workbench.panel.terminal"]'; const XTERM_SELECTOR = `${PANEL_SELECTOR} .terminal-wrapper`; export class Terminal { </ins> constructor(private spectron: SpectronApplication) { } public async showTerminal(): Promise<void> { if (!await this.isVisible()) { await this.spectron.workbench.quickopen.runCommand('View: Toggle Integrated Terminal'); <del> await this.spectron.client.waitForElement(Terminal.TERMINAL_CURSOR); </del> <ins> await this.spectron.client.waitForElement(XTERM_SELECTOR); </ins> await this.waitForTerminalText(text => text.length > 0, 'Waiting for Terminal to be ready'); } } public async isVisible(): Promise<boolean> { <del> const element = await this.spectron.client.element(Terminal.TERMINAL_SELECTOR); </del> <ins> const element = await this.spectron.client.element(PANEL_SELECTOR); </ins> return !!element; }