mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Change default to 0
This commit is contained in:
@@ -198,10 +198,10 @@ export class Viewport extends Disposable implements IViewport {
|
||||
}
|
||||
|
||||
private _smoothScrollPercent(): number {
|
||||
if (!this._optionsService.rawOptions.smoothScrollingDuration || !this._smoothScrollState.startTime) {
|
||||
if (!this._optionsService.rawOptions.smoothScrollDuration || !this._smoothScrollState.startTime) {
|
||||
return 1;
|
||||
}
|
||||
return Math.max(Math.min((Date.now() - this._smoothScrollState.startTime) / this._optionsService.rawOptions.smoothScrollingDuration, 1), 0);
|
||||
return Math.max(Math.min((Date.now() - this._smoothScrollState.startTime) / this._optionsService.rawOptions.smoothScrollDuration, 1), 0);
|
||||
}
|
||||
|
||||
private _clearSmoothScrollState(): void {
|
||||
@@ -238,7 +238,7 @@ export class Viewport extends Disposable implements IViewport {
|
||||
if (amount === 0) {
|
||||
return false;
|
||||
}
|
||||
if (!this._optionsService.rawOptions.smoothScrollingDuration) {
|
||||
if (!this._optionsService.rawOptions.smoothScrollDuration) {
|
||||
this._viewportElement.scrollTop += amount;
|
||||
} else {
|
||||
this._smoothScrollState.startTime = Date.now();
|
||||
|
||||
@@ -37,7 +37,7 @@ export const DEFAULT_OPTIONS: Readonly<ITerminalOptions> = {
|
||||
scrollback: 1000,
|
||||
scrollSensitivity: 1,
|
||||
screenReaderMode: false,
|
||||
smoothScrollingDuration: 125,
|
||||
smoothScrollDuration: 0,
|
||||
macOptionIsMeta: false,
|
||||
macOptionClickForcesSelection: false,
|
||||
minimumContrastRatio: 1,
|
||||
|
||||
@@ -241,7 +241,7 @@ export interface ITerminalOptions {
|
||||
screenReaderMode: boolean;
|
||||
scrollback: number;
|
||||
scrollSensitivity: number;
|
||||
smoothScrollingDuration: number;
|
||||
smoothScrollDuration: number;
|
||||
tabStopWidth: number;
|
||||
theme: ITheme;
|
||||
windowsMode: boolean;
|
||||
|
||||
Vendored
+1
-1
@@ -191,7 +191,7 @@ declare module 'xterm-headless' {
|
||||
* The duration to smoothly scroll between the origin and the target. Set
|
||||
* this to 0 to disable smooth scrolling and scroll instantly.
|
||||
*/
|
||||
smoothScrollingDuration?: number;
|
||||
smoothScrollDuration?: number;
|
||||
|
||||
/**
|
||||
* The size of tab stops in the terminal.
|
||||
|
||||
Vendored
+1
-1
@@ -237,7 +237,7 @@ declare module 'xterm' {
|
||||
* The duration to smoothly scroll between the origin and the target in
|
||||
* milliseconds. Set to 0 to disable smooth scrolling and scroll instantly.
|
||||
*/
|
||||
smoothScrollingDuration?: number;
|
||||
smoothScrollDuration?: number;
|
||||
|
||||
/**
|
||||
* The size of tab stops in the terminal.
|
||||
|
||||
Reference in New Issue
Block a user