diff --git a/lib/components/term.js b/lib/components/term.js index 489f9a1c..7435070d 100644 --- a/lib/components/term.js +++ b/lib/components/term.js @@ -150,6 +150,19 @@ export default class Term extends Component { } write(data) { + // sometimes the preference set above for + // `receive-encoding` is not known by the vt + // before we type to write (since the preference + // manager is asynchronous), so we force it to + // avoid buffering + // this fixes a race condition where sometimes + // opening new sessions results in broken + // output due to the term attempting to decode + // as `utf-8` instead of `raw` + if (this.term.vt.characterEncoding !== 'raw') { + this.term.vt.characterEncoding = 'raw'; + } + this.term.io.writeUTF8(data); }