mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 12:38:39 -09:00
fix decoding race condition with new terminal sessions (#1366)
This commit is contained in:
parent
2b56ab27ad
commit
74df6920e9
1 changed files with 13 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue