* 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
The terminal keydown handler was set to filter out all key bindings that
have a registered global handler, regardless of whether they actually
propagated or not. This allowed the global handlers to still work
despite the terminal input having precedence, but it also meant that
global key bindings that were invalid for the current context would
still get eaten and not sent to stdin.
Now, the terminal keydown handler will directly call the global handlers
so we can actually see whether or not the global key binding is valid.
If the global handler is valid, it'll be processed immediately and stdin
won't receive the input. If it's not handled, we'll let xterm pass it to
stdin. Because anything xterm doesn't handle gets sent to the
globally-registered version of the handler, we need to make sure we
don't do extra work to process an input we've already checked. We'll
store the last-handled keydown event as a static variable so we can
dedupe later calls for the same event to prevent doing double work.
This adds support for searching the terminal buffer using the
`@xterm/addon-search` library. It also adds three options for searching:
regex, case-sensitive, and whole-word. These can be included or excluded
from the search options for `useSearch` depending on whether the search
backend supports it.
![image](https://github.com/user-attachments/assets/e0b7e2ed-641b-463f-94a2-f24969fb3b06)
I didn't like any of the Font Awesome icons for these toggles so until
we have time to make some of our own icons that better match the Font
Awesome style, I've appropriated VSCode's icons from their [codicons
font](https://github.com/microsoft/vscode-codicons).
To implement the toggle-able buttons for these options, I've introduced
a new HeaderElem component, `ToggleIconButton`. This is styled similarly
to `IconButton`, but when you hover over it, it also shows a highlighted
background and when active, it shows as fully-opaque and with an
accented border.
Also removes the `useDismiss` behavior for the search box to better
match behavior in other apps.
Also fixes the scrollbar observer from my previous PR so it's wider.
fixed issue #1613 partially,
added window:dimensions as a setting which gives the user to define
dimensions.
fixed the zoom in and out logic to prevent the app from crashing.
Had issues with getting setting zoomfactor in emain-tabview.ts. will fix
it
I did not mean to close the previous pr, anyway i tried to implement
what you suggested, the backend now does most of it
and DeleteWorkspace will return an unclaimed id and avoid closing the
window.
```go
const moveToNewWorkspace = await WorkspaceService.DeleteWorkspace(workspaceId)
console.log("delete-workspace done", workspaceId, ww?.waveWindowId);
if (ww?.workspaceId == workspaceId){
if ( workspaceList?.length > 1 ) {
await ww.switchWorkspace(moveToNewWorkspace)
} else {
console.log("delete-workspace closing window", workspaceId, ww?.waveWindowId);
ww.destroy();
}
}
});
```
![unknown_2024 12 26-17
05](https://github.com/user-attachments/assets/9c8455e5-b71c-479d-a15c-ee5c99c7a909)
![unknown_2024 12 26-17
06](https://github.com/user-attachments/assets/5dbf63bc-1ffd-4088-abc0-7c02fac9af94)
---------
Co-authored-by: Evan Simkowitz <esimkowitz@users.noreply.github.com>
As connections can now be stored in the internal connection, a missing
or invalid ssh config should not cause the entire list of connections to
be empty. This change ignores the error from the ssh config and proceeds
to construct the list without it.
- Fixed an issue where `fullConfig` was not passed to `setTimeout` in
`getSpareTab`.
- Wrapped `ensureHotSpareTab` with an arrow function to ensure
`fullConfig` is properly passed.
**When I use wave as my terminal, sometimes the setting does not work. I
read the source code and found this issue**
Co-authored-by: Evan Simkowitz <esimkowitz@users.noreply.github.com>
This is a bit janky. The problem is that we were placing the
`xterm-viewport` div, which contains the scroll observer for the xterm
contents, at a higher z-index than the xterm contents, meaning that the
contents couldn't register any pointer events. If we don't put a
z-index, though, the scroll bar can't accept pointer events. To get
around this, I've added two observer divs, which control whether the
contents or the viewport have pointer event priority. The first div, the
`term-scrollbar-show-observer`, sits above where the scrollbar will be
rendered. When the user hovers over it, it will cause the viewport div
to move to a z-index above the contents. It will also enable a second
div, the `term-scrollbar-hide-observer`, which sits above the viewport
and the term contents, but not blocking the scrollbar. When the user
hovers over this div (indicating their mouse has left the scrollbar),
the viewport div is moved back to its original z-index and the hide
observer is set to `display: none`. This gives pointer event priority
back to the contents div.
This resolves an issue where the user could not click links in the
terminal output.
Resolves#1357
This change allows the user to specify all connection details in an
internal connection rather than forcing them to rely on the ssh config
for certain keywords.
A bunch of the Wave AI types still mentioned OpenAI. Now that most of
them are being used for multiple AI backends, we need to update the
names to be more generic.
This is annoyingly verbose, but will let us still get PRs for minor and
patch updates separately from major updates, so we can continue to
benefit from bugfixes without having to adopt breaking changes.
Also adds a jotai update group
Adds `window:savelastwindow` and `window:confirmclose` settings, which
can be used to alter the default window close behavior. Both of these
default to `true` to maintain the existing default behavior.
If `window:savelastwindow` is unset, the same logic will be used as if
the user had more than one window remaining (see below).
If `window:confirmonclose` is unset, the user will no longer be prompted
to confirm if they are closing a window whose workspace has unsaved
changes (the workspace is not named and it has more than one tab).
This adds a split atom for the messages so that the WaveAI component and
the ChatWindow component don't actually need to watch changes to all of
the messages. This makes the repaining a lot less expensive and makes it
easier to scroll while new messages come in.
I also increased the tolerance on the `determineUnsetScroll` callback so
that the bottom message won't get unattached as easily.