Skip to content

Commit da22b03

Browse files
committed
Make textarea readonly when disableStdin is set
Fixes #5256
1 parent 5018a07 commit da22b03

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/browser/CoreBrowserTerminal.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
437437
this.screenElement.appendChild(this._helperContainer);
438438
fragment.appendChild(this.screenElement);
439439

440-
this.textarea = this._document.createElement('textarea');
440+
const textarea = this.textarea = this._document.createElement('textarea');
441441
this.textarea.classList.add('xterm-helper-textarea');
442442
this.textarea.setAttribute('aria-label', Strings.promptLabel.get());
443443
if (!Browser.isChromeOS) {
@@ -449,6 +449,8 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
449449
this.textarea.setAttribute('autocapitalize', 'off');
450450
this.textarea.setAttribute('spellcheck', 'false');
451451
this.textarea.tabIndex = 0;
452+
this._register(this.optionsService.onSpecificOptionChange('disableStdin', () => textarea.readOnly = this.optionsService.rawOptions.disableStdin));
453+
this.textarea.readOnly = this.optionsService.rawOptions.disableStdin;
452454

453455
// Register the core browser service before the generic textarea handlers are registered so it
454456
// handles them first. Otherwise the renderers may use the wrong focus state.

0 commit comments

Comments
 (0)