Commit graph

105 commits

Author SHA1 Message Date
Mike Sawka
e8ebe88651
Fix for Claude Code Scroll to Top Bug (#2956)
There may be more cases here that I don't know about, but this fixes a
good chunk of them. This catches the CC "repaint" transaction and forces
a scrollToBottom. That should handle context repaints and resize
repaints.

Also adds a new (hidden) terminal escape sequence debugger, and (in dev
mode) adds a last 50 writes cache that can be used to look at and debug
output.
2026-02-27 15:34:35 -08:00
Mike Sawka
1ab58ea98a
Fix bugs with connection switching (#2957)
* Add per blockId mutex to block controller resync
* Pass initial termsize through to startJob
2026-02-27 15:23:55 -08:00
Mike Sawka
458fcc2a5d
New ConnMonitor to Track "Stalled" Connection State for SSH Conns (#2846)
* ConnMonitor to track stalled connections
* New Stalled Overlay to show feedback when we think a connection is
stalled
* New Icon in ConnButton to show stalled connections
* Callbacks in domain socket and PTYs to track activity
2026-02-09 17:11:55 -08:00
Mike Sawka
0fb25daf24
Durable Session PR #5 (Icon Flyover, More Bug Fixes, Corner Cases) (#2825)
* Track wave version when job was created (for future backward compat)
* New Flyover Menu off of "shell durability" icon.  Help + Actions + UX
* Bug with conn typeahead not closing when clicking disconnect
* Auto-reconnect jobs that have been disconnected (check for "gone"
state)
* Disable tab indicator stuff (only indicates tab not block)
* Fix bug with dev logging path on connserver
* Fix bugs with restarting blockcontrollers on startup
* Fix bugs with getting HasExited status from job manager
* Fix startup files, quoting, tilde, etc in start job flow
* ...
2026-02-05 10:15:22 -08:00
Mike Sawka
a70c788ae6
More Durable Shell Bug Fixes (#2822)
* Lots of work on ResyncController, issues with stale data, and
connection switching
* Add+Fix termination messages for shell controller
* Prune done/detached jobs on a timer
* Remove circular dependencies from wcore, use blockclose event in both
jobcontroller and blockcontroller instead of direct calls
* Fix concurrency bugs with job termination
* Send object update events when modifying the block datastructure in
jobcontroller
2026-02-04 11:10:21 -08:00
Mike Sawka
ff9923f486
Session Durability Checkpoint (#2821)
Working on bug fixes and UX. Streams restarting, fixed lots of bugs,
timing issues, concurrency bugs. Get status shipped to the FE to drive
"shield" state display. Deal with stale streams.

Also big UX changes to the block headers. Specialize the terminal
headers to prioritize the connection (sense of place), remove old
terminal icon and word "Terminal" from the header. Also drop "Web" and
"Preview" labels on web/preview blocks.

Added `wsh focusblock` command.
2026-02-03 11:49:52 -08:00
Mike Sawka
01a26d59e6
Persistent Terminal Sessions (+ improvements and bug fixes) (#2806)
Lots of updates across all parts of the system to get this working. Big
changes to routing, streaming, connection management, etc.

* Persistent sessions behind a metadata flag for now
* New backlog queue in the router to prevent hanging
* Fix connection Close() issues that caused hangs when network was down
* Fix issue with random routeids (need to be generated fresh each time
the JWT is used and not fixed) so you can run multiple-wsh commands at
once
* Fix issue with domain sockets changing names across wave restarts
(added a symlink mechanism to resolve new names)
* ClientId caching in main server
* Quick reorder queue for input to prevent out of order delivery across
multiple hops
* Fix out-of-order event delivery in router (remove unnecessary go
routine creation)
* Environment testing and fix environment variables for remote jobs (get
from connserver, add to remote job starts)
* Add new ConnServerInit() remote method to call before marking
connection up
* TODO -- remote file transfer needs to be fixed to not create OOM
issues when transferring large files or directories
2026-01-28 13:30:48 -08:00
Mike Sawka
adc823fd3b
rip out osc 23198 and osc 9283 handlers (#2736) 2026-01-02 11:51:37 -08:00
Mike Sawka
2b243627c3
very large refactor of wshrouter (#2732)
the PR spiraled and ended up being much larger than anticipated.

it is a refactor of wshrouter to have it track "links" as opposed to
just routes. this lets us simplify a lot of things when it comes to
multi-level routing.

* now the router can handle unauthenticated links directly, instead of a
weird limbo in wshproxy
* no more wshmultiproxy
* no more "authtoken" weirdness
* more straightforward handling in connserver (when using router option)

also adds more debugging, more logging, some windows fixes, other wsl
fixes
2026-01-01 17:44:00 -08:00
Mike Sawka
fbb0c4d052
windows, have a new "local" conn option for Git Bash if installed (#2666) 2025-12-12 14:05:48 -08:00
Mike Sawka
0d60950915
default bracketed paste mode ON, add context menu (#2639)
We were too conservative by defaulting ignorebrackedpastemode in
xterm.js to true. it should have been set to false. this solves issues
with pasting multi-line strings into zsh, claude code, etc.

add a new context menu option to more easily disable if you're in a
weird ssh session or a REPL that doesn't support bracketedpaste.
2025-12-05 14:41:17 -08:00
Mike Sawka
e0ca73ad53
builder secrets, builder config/data tab hooked up (#2581)
builder secrets, builder config/data tab hooked up, and tsunami cors
config env var
2025-11-21 10:36:51 -08:00
Mike Sawka
3b97084471
fix tsunami scaffold in build (#2564) 2025-11-14 16:35:37 -08:00
Mike Sawka
347eef289d
more builder updates (#2553)
* load manifest metadata into the FE
* builder only edits draft/ apps (convert local => draft)
* gofmt app.go after saving (AI tools and manual user save)
* dont open duplicate builder windows
* remix app context menu in waveapp
* add icon/iconcolor in appmeta and implement in the wave block frame
2025-11-13 22:47:46 -08:00
Mike Sawka
7ac2f25b04
big improvements to waveapp builder (#2550)
* build manifest
* working on secrets injection (secretstore + secret-bindings.json)
* tool progress indicators
* build output and errors injected as the result of the edit calls so AI
gets instant feedback on edits
* change edits to not be atomic (allows AI to make better progress)
* updated binary location for waveapps
* publish button
* new partial json parser (for sending incremental tool progress
indication)
* updated tsunami view to use new embedded scaffold + config vars
* lots of work on cleaning up the output so it is more useful to users +
AI agents
* fix builder init flow
2025-11-13 17:54:17 -08:00
Mike Sawka
ba573c4bcb
tsunami builder 3 (checkpoint) (#2487)
Got preview hooked up, log output hooked up, environment tab hooked
up... the controller, restarting the apps. it is actually working! still
lots to do and lots of hard coding to fix, but it is coming together...
2025-10-28 13:59:02 -07:00
Mike Sawka
ef5a59e710
tsunami app builder 2 (#2486) 2025-10-27 16:37:15 -07:00
Mike Sawka
d886b5e246
more terminal integration for wave ai (#2470)
- mark last command / prompts in xterm.js
- split out term model into its own file
- try to detect repl/shells/ssh/tmux etc commands that stop wave ai
integration
- show icons in term headers for whether wave ai integration is
available
- keep integration status / last command client side (sync with server
on reload)
2025-10-25 21:47:16 -07:00
Mike Sawka
2e0b3d2569
implement more OSC 16162 for fish, pwsh, and bash (#2462) 2025-10-20 17:29:38 -07:00
Mike Sawka
6a173a6227
working on more terminal context (#2444)
* add automatic OSC 7 support to bash and zsh
* add new wave OSC 16162 (planck length) to get up-to-date shell
information into blockrtinfo. currently implemented only for zsh. bash
will not support as rich of data as zsh, but we'll be able to do some.
* new rtinfo will be used to provide better context for AI in the
future, and to make sure AI is running safe commands.
* added a small local machine description to tab context (so AI knows
we're running on MacOS, Linux, or Windows)
2025-10-17 12:19:40 -07:00
Mike Sawka
d272a4ec03
New AIPanel (#2370)
Massive PR, over 13k LOC updated, 128 commits to implement the first pass at the new Wave AI panel.  Two backend adapters (OpenAI and Anthropic), layout changes to support the panel, keyboard shortcuts, and a huge focus/layout change to integrate the panel seamlessly into the UI.

Also fixes some small issues found during the Wave AI journey (zoom fixes, documentation, more scss removal, circular dependency issues, settings, etc)
2025-10-07 13:32:10 -07:00
Mike Sawka
50cc08a769
add tsunami view in wave (#2350)
checkpoint.  good to merge.  we have a working tsunami view inside of wave (with lots of caveats).  but enough for some dev testing.  merge so we dont drift too far from main and while we're at a stable point.
2025-09-15 12:58:59 -07:00
Mike Sawka
56f03896cb
implement cmd:jwt and fix remote execution of commands (#2292) 2025-08-26 16:23:48 -07:00
Mike Sawka
1913cc5c99
initscript -- support for local files, and overrides in connections.json (#1818) 2025-01-23 15:41:13 -08:00
Mike Sawka
ec07b172e5
pull cmd:env and initscripts into wave terminals (#1793) 2025-01-22 16:04:08 -08:00
Evan Simkowitz
11fec5695c
wsh file overhaul without cross-remote copy and S3 (#1790) 2025-01-22 14:50:09 -08:00
Sylvie Crowe
ad3113e46e
Wshless Connections in Wsl (#1769)
This makes it possible to disable wsh for WSL connections. While this is
not recommended, it brings the code closer to the SSH connection
implementation and will make it easier to consolidate the two in the
future.
2025-01-17 18:28:46 -08:00
Mike Sawka
1cd1744317
remove two calls to conn.Connect() (#1757) 2025-01-16 17:32:41 -08:00
Sylvie Crowe
ff5f26709c
WSL Updates for New Architecture (#1756)
This adapts most of the WSL code to follow the new architecture that ssh
uses.

---------

Co-authored-by: sawka <mike@commandline.dev>
2025-01-16 15:54:58 -08:00
Mike Sawka
9dc9066a81
conn updates 5 (#1755)
* token swap
* setting environment variables for different local/remote shells
* bug fixes for init scripts
* more logging
* update connserver startup flow
2025-01-16 11:17:29 -08:00
Mike Sawka
a24fe750c5
conn updates 4 (#1726) 2025-01-14 14:09:26 -08:00
Mike Sawka
ba5f929b3f
conn updates 3 (#1711)
lots of misc connection refactoring / fixes:

* adds blocklogger as a way to writing logging information from the backend directly to the a terminal block
* use blocklogger in conncontroller
* use blocklogger in sshclient
* fix remote name in password prompt
* use sh -c to get around shell weirdness
* remove cmd.exe special cases
* use GetWatcher().GetFullConfig() rather than re-reading the config file
* change order of things we do when establishing a connection.  ask for wsh up front.  then do domain socket, then connserver
* reduce number of sessions required in the common case when wsh is already installed.  running the connserver is now a "multi-command" which checks if it is installed, then asks for the version
* send jwt token over stdin instead of in initial command string
* fix focus bug for frontend conn modal
* track more information in connstatus
* simplify wshinstall function
* add nowshreason
* other misc cleanup
2025-01-10 14:09:32 -08:00
Evan Simkowitz
b51ff834b2
Happy new year! (#1684)
Update all 2024 references to 2025
2025-01-04 20:56:57 -08:00
Mike Sawka
4fd6d36d8e
conn updates 2 (#1660)
* use pwsh over powershell if installed (on windows) for default shell
* refactor blockcontroller.DoRunShellCommand into a "setup" and "manage" phase
* fix wshcmd-conn to also disconnect wsl connections
* new genconn interfaces to make a standardized environment to run SSH/WSL commands via `sh -c`.  also create better quoting functions that are composable
* replace html/template with text/template for shell command templating (avoids special chars getting turned into HTML entities, breaking the commands)
* do not reinstall wsh if the installed version has a higher version (prevents flip-flopping on shared systems)
* simplify clientOs/clientArch detection.  use `uname -sm`.  also validate the os/arch combo as compatible with our builds.
* replace CpHostToRemote with CpWshToRemote. hard codes wsh paths inside of the function instead of having them passed in (quoting restrictions)
* new SyncBuffer class to use with commands that properly synchronizes Writes/String output
* fix setTermSize to actually update DB with terminal size
2025-01-02 14:15:32 -08:00
Mike Sawka
fe91d167b6
fix all panichandlers for the new format (inline recover()) (#1659) 2024-12-31 09:31:55 -08:00
Mike Sawka
878a7285ab
implement tab:preset, and increase active tab opacity (#1439) 2024-12-09 14:48:16 -08:00
Mike Sawka
ac8dc25ead
fix block controller status (add version) (#1430) 2024-12-06 19:39:58 -08:00
Mike Sawka
00e3c4ec75
fix bcstart -- don't allow two controllers to start simultaneously (#1418) 2024-12-06 11:08:51 -08:00
Sylvie Crowe
6dfc85b324
Retry Without Wsh on Fail (#1406)
Adds the ability for connections to continue without wsh if they fail.
This involves creating a menu that warns the user that wsh could not be
used.
2024-12-06 10:11:38 -08:00
Mike Sawka
72f36a9639
wsh run (#1376)
implements `wsh run` command.  lots of fixes (and new options) for command blocks.  cleans up the UX/UI for command blocks.  lots of bug fixes for blockcontrollers.  other minor bug fixes.

also makes editor:* vars into settings override atoms.
2024-12-04 14:16:50 -08:00
Sylvie Crowe
24103213aa
SSH without using WSH (#1355) 2024-11-27 16:52:00 -08:00
Mike Sawka
360964d4ba
panic handlers everywhere (#1327) 2024-11-20 18:05:13 -08:00
Mike Sawka
701d93884d
vdom 4 (#1110) 2024-10-23 22:47:29 -07:00
Sylvie Crowe
8248637e00
WSL Integration (#1031)
Adds support for connecting to local WSL installations on Windows.

(also adds wshrpcmmultiproxy / connserver router)
2024-10-23 22:43:17 -07:00
sawka
cf1b082c10 Merge remote-tracking branch 'origin/main' into dev-v0.9 2024-10-22 09:59:15 -07:00
Evan Simkowitz
1fc6dd7c1a
Fix code scanning alert no. 50: Size computation for allocation may overflow (#1088)
Fixes
[https://github.com/wavetermdev/waveterm/security/code-scanning/50](https://github.com/wavetermdev/waveterm/security/code-scanning/50)

To fix the problem, we need to ensure that the size computation for the
allocation does not overflow. This can be achieved by validating the
length of `barr` before performing the arithmetic operation. We will set
a maximum allowable size for `barr` to ensure that the sum of
`oscPrefixLen(oscNum)` and `len(barr)` does not exceed the maximum value
for an `int`.

1. Define a maximum allowable size for `barr` (e.g., 64 MB).
2. Check the length of `barr` against this maximum size before
performing the allocation.
3. If `barr` exceeds the maximum size, return an error.


_Suggested fixes powered by Copilot Autofix. Review carefully before
merging._

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-21 14:05:52 -07:00
sawka
0590ba2509 merge main to dev 0.9 2024-10-18 09:29:39 -07:00
Mike Sawka
dc70ab4014
ws reconnection bug + clean up logging (#1058) 2024-10-17 23:42:55 -07:00
Mike Sawka
c1c90bb4f8
browser view (#1005) 2024-10-17 14:34:02 -07:00
Mike Sawka
2fa88c4e50
add term:localshellopts (#914) 2024-09-30 21:19:07 -07:00