org-arl / fjage

Framework for Java and Groovy Agents
https://fjage.readthedocs.io/en/latest/
Other
26 stars 13 forks source link

Keep Web Shell and backing ConsoleShell PTY widths in sync #296

Open notthetup opened 10 months ago

notthetup commented 10 months ago

Currently, we use xterm and xterm's add-on fit to paint the web-based terminal and resize it when the webpage is resized.

However, that changes the width of the terminal and we need to let the PTY know that this has happened so it can re-render.

Now, the problem is we use a single PTY to serve multiple web shells, so there is no way we can keep all those web shells in sync while they resize.

So we need to explore of ways we can resize the web shell without changing it's width.

notthetup commented 2 months ago
1920x1080 Monitor : rows: 56 cols: 212
MBP Monitor : rows: 47 cols: 167
iPhone SE : rows: 102 cols: 108
iPhone 14 : rows: 124 cols: 108
Samsung Galaxy S8+ : rows: 118 cols: 108
Samsung Galaxy S20 : rows: 126 cols: 109
iPad Air :  rows: 69 cols: 90
ettersi commented 2 months ago

We discussed that one option might be to have the shell size follow the first connected web shell.

notthetup commented 2 months ago

We discussed that one option might be to have the shell size follow the first connected web shell.

  • Advantage: We get the ideal behaviour if there is only a single connected shell.
  • Disadvantage: Might be confusing / annoying if you forget / lose track of the first tab you opened.

Indeed. But there is no clean way to support using a single PTY to serve multiple web shells where each could have a different number of rows/columns.