Skip to content

Terminal API: debounce onData()? #48513

Closed

Description

Refs: #48434

It looks like every single character I type produces a onData event in the terminal. Should this maybe be debounced? What is the scenario for having this API that it needs to fire on each keystroke?

Activity

  1. Tyriar commented on Apr 24, 2018

    @Tyriar
    Contributor

    I was actually introducing this at a lower level than this, but it would probably not be enabled for standard vscode terminals microsoft/node-pty#189, it may actually slow things down unless things are going over the wire.

    Some debouncing would be a good idea between the renderer and extension host.

  2. added
    bug
    terminal
    on Apr 24, 2018
  3. added this to the May 2018 milestone on Apr 24, 2018
  4. added
    help wanted
    on May 25, 2018
  5. added 3 commits that reference this issue on Oct 9, 2019
    3525639
    c8d1fc7
    ee9573a
  6. 15 remaining items

  7. added a commit that references this issue on Oct 24, 2019
  8. added
    debt
    and removed
    bug
    on Oct 29, 2019
  9. added
    verification-needed
    on Oct 29, 2019
  10. JacksonKearl commented on Oct 30, 2019

    @JacksonKearl
    Contributor

    Is this user-facing? How can I verify?

  11. added
    verification-steps-needed
    and removed
    verified
    on Oct 30, 2019
  12. Tyriar commented on Oct 30, 2019

    @Tyriar
    Contributor

    Eric Amodio (@eamodio) can you put some steps in please?

  13. eamodio commented on Oct 30, 2019

    @eamodio
    Contributor

    To test this you need to create an extension:

    1. Run npx -p yo -p generator-code -c 'yo code --extensionType=command-ts' to scaffold an extension
    2. Add "enableProposedApi": true to the package.json
    3. Change "activationEvents" in the package.json to "activationEvents": ["*"]
    4. Replace the activate function in extension.ts with the following
    export function activate(context: vscode.ExtensionContext) {
        context.subscriptions.push(
            (vscode.window as any).onDidWriteTerminalData(
                (e: { readonly terminal: vscode.Terminal; readonly data: string }) => {
                    console.log(`${e.terminal.name}\n${e.data}`);
                }
            )
        );
    }
    1. Run the extension and switch to the Debug Console
    2. In the newly launched vscode extension host window, open a terminal and run an ls command or a command that will output a bunch of data
    3. Back in the original vscode window, in the Debug Console ensure you see the output from the terminal with multiple lines for each event (prior to these changes it would have only be 1 line per event at most)
  14. removed
    verification-steps-needed
    on Oct 30, 2019
  15. locked and limited conversation to collaborators on Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debthelp wantedperfterminalverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions