Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue for #168192 #211289

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: node_js
node_js:
- "14" # Use Node.js 14
- "16" # Use Node.js 16
- "18" # Use Node.js 18, or the current LTS version

# Use the cache option to speed up builds by caching directories like node_modules
cache:
directories:
- "node_modules"

# Use the install step to install dependencies and any specific global packages
install:
- nvm install 18.15
- yarn install # Install dependencies listed in your package.json file
- yarn install -g typescript # Install TypeScript globally

# Use the script step to compile TypeScript and run any tests or other scripts
script:
- tsc # Compile TypeScript files
- yarn test # Run tests specified in the package.json scripts section
33 changes: 33 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach
}));

// Load addons
this._setupXOFFXONHandling();
this._updateUnicodeVersion();
this._markNavigationAddon = this._instantiationService.createInstance(MarkNavigationAddon, _capabilities);
this.raw.loadAddon(this._markNavigationAddon);
Expand Down Expand Up @@ -405,6 +406,38 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach
}
}

private _setupXOFFXONHandling() {
this.raw.onData(data => {
if (data === '\x13') { // XOFF (Ctrl+S)
this._showPauseNotification();
} else if (data === '\x11') { // XON (Ctrl+Q)
// Handling when XON is received could be added here.
}
});
}

private _showPauseNotification() {
const actions = [{
label: 'Resume',
run: () => this._sendResumeSignal()
}];
this._notificationService.prompt(
2, // Corresponds to severity level (info in this case).
'The terminal is paused. Press Ctrl+Q to resume.',
actions, // Actions array containing the resume action.
{
sticky: true,
neverShowAgain: { id: 'terminalPauseNotification', isSecondary: true }
}
);
}

private _sendResumeSignal() {
this.raw.write('\x11'); // Send XON (Ctrl+Q) to resume terminal operations.
}



private _updateSmoothScrolling() {
this.raw.options.smoothScrollDuration = this._terminalConfigurationService.config.smoothScrolling && this._isPhysicalMouseWheel ? RenderConstants.SmoothScrollDuration : 0;
}
Expand Down