mirror of https://github.com/oupson/FooTerm.git
Inform remote that terminal size changed
This commit is contained in:
parent
df40cbf7a9
commit
3df4119fa0
|
@ -34,6 +34,9 @@ namespace Footerm {
|
||||||
|
|
||||||
private Footerm.Model.Server? server;
|
private Footerm.Model.Server? server;
|
||||||
|
|
||||||
|
private int old_terminal_width = 0;
|
||||||
|
private int old_terminal_height = 0;
|
||||||
|
|
||||||
construct {
|
construct {
|
||||||
this.configure_terminal();
|
this.configure_terminal();
|
||||||
}
|
}
|
||||||
|
@ -78,15 +81,22 @@ namespace Footerm {
|
||||||
|
|
||||||
private void configure_terminal() {
|
private void configure_terminal() {
|
||||||
this.terminal.set_enable_sixel(true);
|
this.terminal.set_enable_sixel(true);
|
||||||
this.terminal.char_size_changed.connect(() => {
|
this.terminal.char_size_changed.connect(this.terminal_appearance_changed);
|
||||||
var pty = this.terminal.get_pty();
|
this.terminal.contents_changed.connect(this.terminal_appearance_changed);
|
||||||
if (pty != null && this.channel != null) {
|
}
|
||||||
int rows = 0;
|
|
||||||
int columns = 0;
|
private void terminal_appearance_changed() {
|
||||||
pty.get_size(out rows, out columns);
|
var pty = this.terminal.get_pty();
|
||||||
|
if (pty != null && this.channel != null) {
|
||||||
|
int rows = 0;
|
||||||
|
int columns = 0;
|
||||||
|
pty.get_size(out rows, out columns);
|
||||||
|
if (rows != this.old_terminal_height || columns != this.old_terminal_width) {
|
||||||
|
this.old_terminal_height = rows;
|
||||||
|
this.old_terminal_width = columns;
|
||||||
this.channel.request_pty_size(columns, rows);
|
this.channel.request_pty_size(columns, rows);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void create_pty() throws GLib.IOError {
|
private void create_pty() throws GLib.IOError {
|
||||||
|
|
Loading…
Reference in New Issue