-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Passing cols or rows into ctor as undefined will break terminal #3453
Conversation
@@ -10,13 +10,23 @@ describe('OptionsService', () => { | |||
describe('constructor', () => { | |||
const originalError = console.error; | |||
beforeEach(() => { | |||
console.error = () => {}; | |||
console.error = () => { }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should revert this formatting change
it('uses default value if invalid constructor option value passed', () => { | ||
assert.equal(new OptionsService({tabStopWidth: 0}).getOption('tabStopWidth'), DEFAULT_OPTIONS.tabStopWidth); | ||
assert.equal(new OptionsService({ tabStopWidth: 0 }).getOption('tabStopWidth'), DEFAULT_OPTIONS.tabStopWidth); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert.equal(new OptionsService({ tabStopWidth: 0 }).getOption('tabStopWidth'), DEFAULT_OPTIONS.tabStopWidth); | |
assert.equal(new OptionsService({tabStopWidth: 0}).getOption('tabStopWidth'), DEFAULT_OPTIONS.tabStopWidth); |
@@ -22,7 +22,7 @@ export const DEFAULT_OPTIONS: ITerminalOptions = Object.freeze({ | |||
cursorStyle: 'block', | |||
cursorWidth: 1, | |||
customGlyphs: true, | |||
bellSound: DEFAULT_BELL_SOUND, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo
@@ -128,7 +128,7 @@ export class OptionsService implements IOptionsService { | |||
break; | |||
case 'cursorWidth': | |||
value = Math.floor(value); | |||
// Fall through for bounds check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, thanks - a few formatting changes should be reverted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
xterm.js/src/common/services/BufferService.ts
Lines 39 to 40 in 554f7da
Passing
undefined
to cols or rows would result in NaN. Passingnull
works as expected.Fixes #3329