Drop rows and columns as terminal will fit the container automatically

This commit is contained in:
iliajie
2022-10-24 18:30:29 +03:00
parent cc70ab2f39
commit 6ad8c64c31
3 changed files with 1 additions and 11 deletions

View File

@@ -1,3 +1 @@
base_port=555
cols=80
rows=24

View File

@@ -1,3 +1 @@
base_port=Base port number for Websockets connections,0,5
cols=Terminal width in characters,0,5
rows=Terminal height in characters,0,5

View File

@@ -61,15 +61,9 @@ print &ui_table_row(undef, "<div id=terminal></div>", 2);
print &ui_table_end();
print "</center>\n";
my $url = "wss://".$ENV{'HTTP_HOST'}.$wspath;
my $rows = $config{'rows'} || 24;
my $cols = $config{'cols'} || 80;
print <<EOF;
<script>
var term = new Terminal({
rows: $rows,
cols: $cols,
});
term.open(document.getElementById('terminal'));
var term = new Terminal();
var socket = new WebSocket('$url', 'binary');
var attachAddon = new AttachAddon.AttachAddon(socket);
term.loadAddon(attachAddon);