Commit Graph

20 Commits

Author SHA1 Message Date
fang
1c36ad129d
webterm: avoid needless %blew tasks
Any change to the session object was triggering this. But that now includes
an "unacked keystrokes" counter, which updates frequently, and we
definitely don't want to send resize notifications in that case.
2022-09-17 10:38:04 +02:00
tomholford
8d0ca32c5d
ux: show a keypress indicator after a delay 2022-07-17 15:16:35 +02:00
fang
d7ec69803f
webterm: add ugly keypress processing indicator
Needs to be made prettier by displaying only after a delay, have a cute
little animation, etc.
2022-07-17 15:15:10 +02:00
fang
f58bdbcec4
webterm: handle ctrl+shift key events specially
xterm.js seems to have a bug where it doesn't register ctrl+uppercase
keypresses correctly. To work around this, we catch such keypresses
explicitly and handle them inline.
2022-07-08 20:44:21 +02:00
fang
dc81adb735
webterm: send simple keystrokes simply
%txt should be reserved for chunks of pasted text and other
non-keystroke text inputs. Perhaps at a later point in time we'll handle
paste events explicitly, letting this be more accurate.
2022-05-15 01:13:54 +02:00
tomholford
2d3e803704 devex: improved resize behavior
- only resize when necessary (check the container's height)
- refactor CSS: use position relative / absolute to stack Buffers instead of display:none; this affects the calcuations used by fit()
- fix dark mode styles, tweak viewport height (100vh --> 99vh) to prevent overflow scroller
2022-04-19 03:41:40 -07:00
tomholford
dfded5e592 ux: refactor resize behavior
- debounced resize event listener
- new Buffer#onSelect: resize, focus, and pokes `herm` with updated rows / cols
- simplify container ref implementation (no need for a callback ref), remove isOpen hack
- add lodash for debounce
- Tab#onClick no longer handles focus (it's now handled by Buffer#onSelect)
2022-04-14 07:13:09 -07:00
tomholford
37ce741a77 deps: replace deprecated xterm#setOption
See:
https://github.com/xtermjs/xterm.js/blob/4.15.0/typings/xterm.d.ts#L1053
2022-04-14 04:52:43 -07:00
tomholford
349033fb12 ux: detect OS for hotkey instructions
Also, ensure changes from this PR are included in the session branch:
https://github.com/urbit/urbit/pull/5529
2022-04-13 08:47:30 -07:00
fang
064b15e5a0
term: move coordinate origin to top left
Having the origin at the top left instead of the bottom left is more
conventional and ergonomic. The only thing this complicates is
prompt-specific logic, where we care about the coordinates of the
bottom-most line on the screen.

For that reason, the bulk of the changes here are in vere, where we
treat the bottom-most line specially, drawing the spinner onto it.
Webterm is likewise updated to account for the new coordinate system.

Drum now opts to accept clicks anywhere on the screen, and does its best
to move the cursor as close to the clicked location as possible (within
the confines of the prompt).
2022-04-03 21:38:09 +02:00
fang
60ed368bc4
webterm: fix bell icon in tabs
Presumably due to how js non-objects work in closures, the selected prop
we were reading out whenever a blit came in was stale.

Also, it was possible that a bell was hiding inside a %mor blit, so we
add a small helper for checking properly.
2022-03-25 15:38:56 +01:00
fang
01de5a06b0
term: consistently use x/y coordinate ordering
%rez has always used "width & height". Certainly, "x & y" is more
standard than "row & column". As such, we settle on making %hop and %hit
respect the more natural ordering. This change is safe because these
interfaces haven't made it to livenet yet.
2022-03-25 13:45:29 +01:00
fang
0d2c135959
webterm: small cleanup, comments
Also includes a more-sane prompt() description.
2022-03-15 01:34:19 +01:00
tomholford
bf0f4e97c9 api: exponential backoff when resubscribing
Use the new `lib/retry` to attempt to reconnect when clogged. If unsucessful after 5 attempts, stop retrying and log an error.
2022-03-10 22:54:30 -06:00
tomholford
200b504c4e api: resubscribe after clog 2022-03-10 00:03:27 -06:00
tomholford
ee492e6f83 devex: cleaning up lint issues 2022-03-09 16:25:10 -06:00
tomholford
87ac253b8d ux: default terminal sets correct theme onload
also, increase size of Tab click target
2022-03-03 18:11:37 -06:00
tomholford
438e6d4df9 ui: style tabs
also rename join --> useDark; clean up extraneous logging statements
2022-03-03 17:10:54 -06:00
tomholford
fe1ece47d8 api: clean up subscriptions on deletion of session
On subscribe, track the subcription ID in the Session state.

On deletion, unsubscribe using the same ID.
2022-03-03 17:09:38 -06:00
fang
d98611a04b
webterm: support multiple sessions
Fully implements webterm support for multiple dill terminal sessions.

Remaining work includes styling, session creation safety (name-wise),
and general cleanup.

Co-authored-by: tomholford <tomholford@users.noreply.github.com>
Co-authored-by: liam-fitzgerald <liam@tlon.io>
2022-03-02 17:34:19 -06:00