mirror of
https://github.com/tsl0922/ttyd.git
synced 2025-12-24 12:44:20 +01:00
Refit to the browser window after changing font size (#416)
Fixes #415 Signed-off-by: Ondřej Caletka <ondrej@caletka.cz>
This commit is contained in:
@@ -233,7 +233,7 @@ export class Xterm extends Component<Props> {
|
||||
|
||||
@bind
|
||||
private onSocketData(event: MessageEvent) {
|
||||
const { terminal, textDecoder, zmodemAddon } = this;
|
||||
const { terminal, textDecoder, zmodemAddon, fitAddon } = this;
|
||||
const rawData = event.data as ArrayBuffer;
|
||||
const cmd = String.fromCharCode(new Uint8Array(rawData)[0]);
|
||||
const data = rawData.slice(1);
|
||||
@@ -262,6 +262,12 @@ export class Xterm extends Component<Props> {
|
||||
console.log('[ttyd] Leave site alert disabled');
|
||||
}
|
||||
break;
|
||||
case 'fontSize':
|
||||
console.log(`[ttyd] setting font size to ${preferences[key]}`);
|
||||
terminal.setOption(key, preferences[key]);
|
||||
fitAddon.fit();
|
||||
break;
|
||||
|
||||
default:
|
||||
console.log(`[ttyd] option: ${key}=${preferences[key]}`);
|
||||
terminal.setOption(key, preferences[key]);
|
||||
|
||||
17440
src/html.h
17440
src/html.h
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user