Compare commits

..

2 Commits

Author SHA1 Message Date
Sylvia Crowe 0cdb63bec8 fix: frontend changes for shell pref in imports
This continues the previous changes to allow the shell to be configured
after importing the ssh_config file. This allows temporary editing of
the shell preference for imported remotes as well as adding a keywork to
allow it to be set in the ssh_config file.
2024-01-31 12:56:26 -08:00
Sylvia Crowe 0417c8a158 fix: set shellpref default settings for backend
The shell preference is a new feature that was never integrated into ssh
config importing. This makes the backend changes to allow that to
happen.
2024-01-31 12:17:33 -08:00
20 changed files with 43 additions and 150 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
name: "Build Helper"
on: workflow_dispatch
env:
WAVETERM_VERSION: 0.6.3
WAVETERM_VERSION: 0.6.1
GO_VERSION: "1.21.5"
NODE_VERSION: "21.5.0"
jobs:
+1 -1
View File
@@ -1,7 +1,7 @@
#!/bin/bash
# assumes we have Wave-darwin-x64-[version].zip and Wave-darwin-arm64-[version].zip in current directory
VERSION=0.6.3
VERSION=0.6.1
rm -rf temp
rm -rf builds
mkdir temp
-1
View File
@@ -1,4 +1,3 @@
github.com/aws/aws-sdk-go-v2/service/s3 v1.27.11 h1:3/gm/JTX9bX8CpzTgIlrtYpB3EVBDxyg/GY/QdcIEZw=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "waveterm",
"author": "Command Line Inc",
"productName": "Wave",
"version": "0.6.3",
"version": "0.6.1",
"main": "dist/emain.js",
"license": "Apache-2.0",
"dependencies": {
+1 -6
View File
@@ -49,7 +49,6 @@ type OV<V> = mobx.IObservableValue<V>;
type OArr<V> = mobx.IObservableArray<V>;
const RemotePtyRows = 9;
const RemotePtyTotalRows = 25;
const RemotePtyCols = 80;
const NumOfLines = 50;
const PasswordUnchangedSentinel = "--unchanged--";
@@ -1185,11 +1184,7 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
ref={this.termRef}
data-remoteid={remote.remoteid}
style={{
height: textmeasure.termHeightFromRows(
RemotePtyRows,
termFontSize,
RemotePtyTotalRows
),
height: textmeasure.termHeightFromRows(RemotePtyRows, termFontSize),
width: termWidth,
}}
></div>
@@ -16,7 +16,6 @@ import * as textmeasure from "../../../util/textmeasure";
import "./viewremoteconndetail.less";
const RemotePtyRows = 9;
const RemotePtyTotalRows = 25;
const RemotePtyCols = 80;
@mobxReact.observer
@@ -372,11 +371,7 @@ class ViewRemoteConnDetailModal extends React.Component<{}, {}> {
ref={this.termRef}
data-remoteid={remote.remoteid}
style={{
height: textmeasure.termHeightFromRows(
RemotePtyRows,
termFontSize,
RemotePtyTotalRows
),
height: textmeasure.termHeightFromRows(RemotePtyRows, termFontSize),
width: termWidth,
}}
></div>
@@ -29,7 +29,6 @@ type OArr<V> = mobx.IObservableArray<V>;
type OMap<K, V> = mobx.ObservableMap<K, V>;
const RemotePtyRows = 8;
const RemotePtyTotalRows = 25;
const RemotePtyCols = 80;
const PasswordUnchangedSentinel = "--unchanged--";
@@ -1050,7 +1049,7 @@ class RemoteDetailView extends React.Component<{ model: RemotesModalModel; remot
ref={this.termRef}
data-remoteid={remote.remoteid}
style={{
height: textmeasure.termHeightFromRows(RemotePtyRows, termFontSize, RemotePtyTotalRows),
height: textmeasure.termHeightFromRows(RemotePtyRows, termFontSize),
width: termWidth,
}}
></div>
+1 -1
View File
@@ -399,7 +399,7 @@ class LineCmd extends React.Component<
let height = 45 + 24; // height of zero height terminal
const usedRows = screen.getUsedRows(lineutil.getRendererContext(line), line, cmd, width);
if (usedRows > 0) {
height = 48 + 24 + termHeightFromRows(usedRows, GlobalModel.termFontSize.get(), cmd.getTermMaxRows());
height = 48 + 24 + termHeightFromRows(usedRows, GlobalModel.termFontSize.get());
}
return height;
}
+6 -5
View File
@@ -84,14 +84,11 @@
}
.meta.meta-line1 {
margin-left: 2px;
color: rgba(@base-color, 0.6) !important;
font-size: 11px;
}
.meta.meta-line2 {
margin-left: -2px;
}
&.has-rtnstate .terminal-wrapper {
padding-bottom: 0;
}
@@ -116,6 +113,11 @@
overflow-x: hidden;
}
.terminal {
margin-right: 8px;
padding: 0.25rem;
}
&.cmd-done .terminal .xterm-cursor {
display: none;
}
@@ -464,7 +466,6 @@
padding: 0 0 10px 0;
flex-grow: 1;
position: relative;
overflow-x: hidden;
&::-webkit-scrollbar-thumb {
background-color: transparent !important;
+2
View File
@@ -18,6 +18,8 @@ let MagicLayout = {
ScreenMinContentSize: 100,
ScreenMaxContentSize: 5000,
// the 3 is for descenders, which get cut off in the terminal without this
TermDescendersHeight: 3,
TermWidthBuffer: 15,
TabWidth: 154,
+2 -12
View File
@@ -10,16 +10,7 @@ import { If, For } from "tsx-control-statements/components";
import cn from "classnames";
import { debounce } from "throttle-debounce";
import dayjs from "dayjs";
import {
GlobalCommandRunner,
TabColors,
TabIcons,
ForwardLineContainer,
GlobalModel,
ScreenLines,
Screen,
Session,
} from "../../../model/model";
import { GlobalCommandRunner, TabColors, TabIcons, ForwardLineContainer, GlobalModel, ScreenLines, Screen, Session } from "../../../model/model";
import type { LineType, RenderModeType, LineFactoryProps } from "../../../types/types";
import * as T from "../../../types/types";
import localizedFormat from "dayjs/plugin/localizedFormat";
@@ -123,7 +114,6 @@ class ScreenView extends React.Component<{ session: Session; screen: Screen }, {
return <div className="screen-view" ref={this.screenViewRef}></div>;
}
let fontSize = GlobalModel.termFontSize.get();
let dprStr = sprintf("%0.3f", GlobalModel.devicePixelRatio.get());
let viewOpts = screen.viewOpts.get();
let hasSidebar = viewOpts?.sidebar?.open;
let winWidth = "100%";
@@ -160,7 +150,7 @@ class ScreenView extends React.Component<{ session: Session; screen: Screen }, {
return (
<div className="screen-view" data-screenid={screen.screenId} ref={this.screenViewRef}>
<ScreenWindowView
key={screen.screenId + ":" + fontSize + ":" + dprStr}
key={screen.screenId + ":" + fontSize}
session={session}
screen={screen}
width={winWidth}
+3 -39
View File
@@ -170,7 +170,6 @@ function readAuthKey() {
return authKeyStr.trim();
}
let cmdOrAlt = process.platform === "darwin" ? "Cmd" : "Alt";
let menuTemplate = [
{
role: "appMenu",
@@ -199,41 +198,9 @@ let menuTemplate = [
{ role: "reload", accelerator: "Option+R" },
{ role: "toggleDevTools" },
{ type: "separator" },
{
label: "Actual Size",
accelerator: cmdOrAlt + "+0",
click: () => {
if (MainWindow == null) {
return;
}
MainWindow.webContents.setZoomFactor(1);
MainWindow.webContents.send("zoom-changed");
},
},
{
label: "Zoom In",
accelerator: cmdOrAlt + "+Plus",
click: () => {
if (MainWindow == null) {
return;
}
const zoomFactor = MainWindow.webContents.getZoomFactor();
MainWindow.webContents.setZoomFactor(zoomFactor * 1.1);
MainWindow.webContents.send("zoom-changed");
},
},
{
label: "Zoom Out",
accelerator: cmdOrAlt + "+-",
click: () => {
if (MainWindow == null) {
return;
}
const zoomFactor = MainWindow.webContents.getZoomFactor();
MainWindow.webContents.setZoomFactor(zoomFactor / 1.1);
MainWindow.webContents.send("zoom-changed");
},
},
{ role: "resetZoom" },
{ role: "zoomIn" },
{ role: "zoomOut" },
{ type: "separator" },
{ role: "togglefullscreen" },
],
@@ -400,9 +367,6 @@ function createMainWindow(clientData) {
win.on("close", () => {
MainWindow = null;
});
win.webContents.on("zoom-changed", (e) => {
win.webContents.send("zoom-changed");
});
win.webContents.setWindowOpenHandler(({ url, frameName }) => {
if (url.startsWith("https://docs.waveterm.dev/")) {
console.log("openExternal docs", url);
-1
View File
@@ -20,7 +20,6 @@ contextBridge.exposeInMainWorld("api", {
onWCmd: (callback) => ipcRenderer.on("w-cmd", callback),
onPCmd: (callback) => ipcRenderer.on("p-cmd", callback),
onRCmd: (callback) => ipcRenderer.on("r-cmd", callback),
onZoomChanged: (callback) => ipcRenderer.on("zoom-changed", callback),
onMetaArrowUp: (callback) => ipcRenderer.on("meta-arrowup", callback),
onMetaArrowDown: (callback) => ipcRenderer.on("meta-arrowdown", callback),
onMetaPageUp: (callback) => ipcRenderer.on("meta-pageup", callback),
+7 -4
View File
@@ -8,7 +8,6 @@ import { sprintf } from "sprintf-js";
import { App } from "./app/app";
import * as DOMPurify from "dompurify";
import { loadFonts } from "./util/util";
import * as textmeasure from "./util/textmeasure";
// @ts-ignore
let VERSION = __WAVETERM_VERSION__;
@@ -21,14 +20,18 @@ document.addEventListener("DOMContentLoaded", () => {
let reactElem = React.createElement(App, null, null);
let elem = document.getElementById("app");
let root = createRoot(elem);
document.fonts.ready.then(() => {
let isFontLoaded = document.fonts.check("12px 'JetBrains Mono'");
if (isFontLoaded) {
root.render(reactElem);
});
} else {
document.fonts.ready.then(() => {
root.render(reactElem);
});
}
});
(window as any).mobx = mobx;
(window as any).sprintf = sprintf;
(window as any).DOMPurify = DOMPurify;
(window as any).textmeasure = textmeasure;
console.log("WaveTerm", VERSION, BUILD);
+3 -37
View File
@@ -74,7 +74,6 @@ import {
windowHeightToRows,
termWidthFromCols,
termHeightFromRows,
clearMonoFontCache,
} from "../util/textmeasure";
import dayjs from "dayjs";
import localizedFormat from "dayjs/plugin/localizedFormat";
@@ -204,7 +203,6 @@ type ElectronApi = {
onPCmd: (callback: (mods: KeyModsType) => void) => void;
onRCmd: (callback: (mods: KeyModsType) => void) => void;
onWCmd: (callback: (mods: KeyModsType) => void) => void;
onZoomChanged: (callback: () => void) => void;
onMenuItemAbout: (callback: () => void) => void;
onMetaArrowUp: (callback: () => void) => void;
onMetaArrowDown: (callback: () => void) => void;
@@ -308,11 +306,6 @@ class Cmd {
return this.data.get().termopts;
}
getTermMaxRows(): number {
let termOpts = this.getTermOpts();
return termOpts?.rows;
}
getCmdStr(): string {
return this.data.get().cmdstr;
}
@@ -748,7 +741,7 @@ class Screen {
getMaxContentSize(): WindowSize {
if (this.lastScreenSize == null) {
let width = termWidthFromCols(80, GlobalModel.termFontSize.get());
let height = termHeightFromRows(25, GlobalModel.termFontSize.get(), 25);
let height = termHeightFromRows(25, GlobalModel.termFontSize.get());
return { width, height };
}
let winSize = this.lastScreenSize;
@@ -762,7 +755,7 @@ class Screen {
getIdealContentSize(): WindowSize {
if (this.lastScreenSize == null) {
let width = termWidthFromCols(80, GlobalModel.termFontSize.get());
let height = termHeightFromRows(25, GlobalModel.termFontSize.get(), 25);
let height = termHeightFromRows(25, GlobalModel.termFontSize.get());
return { width, height };
}
let winSize = this.lastScreenSize;
@@ -2401,7 +2394,7 @@ class HistoryViewModel {
} else {
this.activeItem.set(hitem.historyid);
let width = termWidthFromCols(80, GlobalModel.termFontSize.get());
let height = termHeightFromRows(25, GlobalModel.termFontSize.get(), 25);
let height = termHeightFromRows(25, GlobalModel.termFontSize.get());
this.specialLineContainer = new SpecialLineContainer(
this,
{ width, height },
@@ -3456,9 +3449,6 @@ class Model {
lineSettingsModal: OV<number> = mobx.observable.box(null, {
name: "lineSettingsModal",
}); // linenum
devicePixelRatio: OV<number> = mobx.observable.box(window.devicePixelRatio, {
name: "devicePixelRatio",
});
remotesModalModel: RemotesModalModel;
remotesModel: RemotesModel;
@@ -3523,7 +3513,6 @@ class Model {
getApi().onPCmd(this.onPCmd.bind(this));
getApi().onWCmd(this.onWCmd.bind(this));
getApi().onRCmd(this.onRCmd.bind(this));
getApi().onZoomChanged(this.onZoomChanged.bind(this));
getApi().onMenuItemAbout(this.onMenuItemAbout.bind(this));
getApi().onMetaArrowUp(this.onMetaArrowUp.bind(this));
getApi().onMetaArrowDown(this.onMetaArrowDown.bind(this));
@@ -3835,29 +3824,6 @@ class Model {
}
}
onZoomChanged(): void {
mobx.action(() => {
this.devicePixelRatio.set(window.devicePixelRatio);
clearMonoFontCache();
})();
}
getSelectedTermWrap(): TermWrap {
let screen = this.getActiveScreen();
if (screen == null) {
return null;
}
let lineNum = screen.selectedLine.get();
if (lineNum == null) {
return null;
}
let line = screen.getLineByNum(lineNum);
if (line == null) {
return null;
}
return screen.getTermWrap(line.lineid);
}
clearModals(): boolean {
let didSomething = false;
mobx.action(() => {
+1 -2
View File
@@ -153,7 +153,7 @@ class TerminalRenderer extends React.Component<
.get();
let cmd = screen.getCmd(line); // will not be null
let usedRows = screen.getUsedRows(lineutil.getRendererContext(line), line, cmd, width);
let termHeight = termHeightFromRows(usedRows, GlobalModel.termFontSize.get(), cmd.getTermMaxRows());
let termHeight = termHeightFromRows(usedRows, GlobalModel.termFontSize.get());
if (usedRows === 0) {
termHeight = 0;
}
@@ -169,7 +169,6 @@ class TerminalRenderer extends React.Component<
{ "zero-height": termHeight == 0 },
{ collapsed: collapsed }
)}
data-usedrows={usedRows}
>
<If condition={!isFocused}>
<div key="term-block" className="term-block" onClick={this.clickTermBlock}></div>
+6 -28
View File
@@ -30,10 +30,6 @@ function getMonoFontSize(fontSize: number): { height: number; width: number } {
return size;
}
function clearMonoFontCache(): void {
MonoFontSizes = [];
}
function measureText(
text: string,
textOpts?: { pre?: boolean; mono?: boolean; fontSize?: number | string }
@@ -61,9 +57,8 @@ function measureText(
throw new Error("cannot measure text, no #measure div");
}
measureDiv.replaceChildren(textElem);
let height = textElem.offsetHeight;
let width = textElem.offsetWidth;
return { width: width, height: Math.ceil(height) };
let rect = textElem.getBoundingClientRect();
return { width: rect.width, height: Math.ceil(rect.height) };
}
function windowWidthToCols(width: number, fontSize: number): number {
@@ -87,27 +82,10 @@ function termWidthFromCols(cols: number, fontSize: number): number {
return Math.ceil(dr.width * cols) + MagicLayout.TermWidthBuffer;
}
// we need to match the xtermjs calculation in CharSizeService.ts and DomRenderer.ts
// it does some crazy rounding depending on the value of window.devicePixelRatio
// works out to `realHeight = round(ceil(height * dpr) * rows / dpr) / rows`
// their calculation is based off the "totalRows" (so that argument has been added)
function termHeightFromRows(rows: number, fontSize: number, totalRows: number): number {
function termHeightFromRows(rows: number, fontSize: number): number {
let dr = getMonoFontSize(fontSize);
const dpr = window.devicePixelRatio;
if (totalRows == null || totalRows == 0) {
totalRows = rows > 25 ? rows : 25;
}
let realHeight = Math.round((Math.ceil(dr.height * dpr) * totalRows) / dpr) / totalRows;
return Math.ceil(realHeight * rows);
// TODO: replace the TermDescendersHeight with some calculation based on termFontSize.
return Math.ceil(dr.height * rows) + MagicLayout.TermDescendersHeight;
}
export {
measureText,
getMonoFontSize,
windowWidthToCols,
windowHeightToRows,
termWidthFromCols,
termHeightFromRows,
clearMonoFontCache,
MonoFontSizes,
};
export { measureText, getMonoFontSize, windowWidthToCols, windowHeightToRows, termWidthFromCols, termHeightFromRows };
+1 -1
View File
@@ -1,2 +1,2 @@
const VERSION = "v0.6.3";
const VERSION = "v0.6.1";
module.exports = VERSION;
+4 -1
View File
@@ -257,7 +257,10 @@ func (z zshShellApi) MakeRcFileStr(pk *packet.RunPacketType) string {
}
rcBuf.WriteString("\n")
}
// do NOT unset ZDOTDIR, otherwise initialization will start to read initialization files from ~/ again
if shellenv.FindVarDecl(varDecls, "ZDOTDIR") == nil {
rcBuf.WriteString("unset ZDOTDIR\n")
rcBuf.WriteString("\n")
}
for _, varName := range ZshUnsetVars {
rcBuf.WriteString("unset " + shellescape.Quote(varName) + "\n")
}
+1 -1
View File
@@ -35,7 +35,7 @@ const WaveLockFile = "waveterm.lock"
const WaveDirName = ".waveterm" // must match emain.ts
const WaveDevDirName = ".waveterm-dev" // must match emain.ts
const WaveAppPathVarName = "WAVETERM_APP_PATH"
const WaveVersion = "v0.6.3"
const WaveVersion = "v0.6.1"
const WaveAuthKeyFileName = "waveterm.authkey"
const MShellVersion = "v0.4.0"