void }, {}> {
render() {
@@ -637,13 +641,15 @@ class LineCmd extends React.Component<
.get();
const isRunning = cmd.isRunning();
const isExpanded = this.isCmdExpanded.get();
+ const cmdError = cmdHasError(cmd);
const mainDivCn = cn(
"line",
"line-cmd",
{ selected: isSelected },
{ active: isSelected && isFocused },
{ "cmd-done": !isRunning },
- { "has-rtnstate": isRtnState }
+ { "has-rtnstate": isRtnState },
+ { "has-error": cmdError }
);
let rendererPlugin: RendererPluginType = null;
const isNoneRenderer = line.renderer == "none";
@@ -663,6 +669,9 @@ class LineCmd extends React.Component<
data-linenum={line.linenum}
data-screenid={line.screenid}
>
+
+
{dateSepStr}
);
lineElements.push(sepElem);
+ } else if (idx > 0) {
+ lineElements.push(
);
}
let topBorder = dateSepStr == null && this.hasTopBorder(lines, idx);
let lineProps = {
diff --git a/src/app/root.less b/src/app/root.less
new file mode 100644
index 000000000..66df7c5c3
--- /dev/null
+++ b/src/app/root.less
@@ -0,0 +1,184 @@
+// Copyright 2024, Command Line Inc.
+// SPDX-License-Identifier: Apache-2.0
+
+:root {
+ --fa-style-family: "Font Awesome 6 Sharp";
+
+ // these variables are overridden by user settings
+ --termfontfamily: "JetBrains Mono", monospace;
+ --termfontsize: 12px;
+ --termlineheight: 15px;
+ --termpad: 7px; // padding value (scaled to termfontsize)
+
+ // global colors
+ --app-accent-color: rgb(88, 193, 66);
+ --app-error-color: rgb(204, 0, 0);
+ --app-warning-color: rgb(255, 165, 0);
+ --app-text-color: rgb(211, 215, 207);
+ --app-text-primary-color: rgb(255, 255, 255);
+ --app-text-secondary-color: rgb(195, 200, 194);
+ --app-border-color: rgb(51, 51, 51);
+ --app-bg-color: rgba(21, 23, 21, 1);
+ --app-bg-color-dev: rgba(21, 23, 48, 1);
+
+ // global generic colors
+ --app-black: rgb(0, 0, 0);
+
+ // scrollbar colors
+ --scrollbar-background-color: rgba(21, 23, 21, 1);
+ --scrollbar-thumb-color: rgb(134, 134, 134);
+
+ // code color
+ --pre-bg-color: rgb(0, 0, 0);
+
+ // tab colors
+ --tab-red: rgb(229, 77, 46);
+ --tab-orange: rgb(239, 113, 59);
+ --tab-yellow: rgb(224, 185, 86);
+ --tab-green: rgb(88, 193, 66);
+ --tab-mint: rgb(75, 255, 169);
+ --tab-cyan: rgb(75, 223, 255);
+ --tab-blue: rgb(57, 113, 255);
+ --tab-violet: rgb(186, 118, 255);
+ --tab-pink: rgb(224, 86, 119);
+ --tab-white: rgb(255, 255, 255);
+
+ // prompt colors
+ --prompt-black: rgb(0, 0, 0);
+ --prompt-white: rgb(211, 215, 207);
+ --prompt-orange: rgb(239, 113, 59);
+ --prompt-blue: rgb(52, 101, 164);
+ --prompt-bright-black: rgb(85, 87, 83);
+ --prompt-bright-red: rgb(239, 41, 41);
+ --prompt-bright-green: rgb(88, 193, 66);
+ --prompt-bright-yellow: rgb(252, 233, 79);
+ --prompt-bright-blue: rgb(50, 175, 255);
+ --prompt-bright-magenta: rgb(173, 127, 168);
+ --prompt-bright-cyan: rgb(52, 226, 226);
+ --prompt-bright-white: rgb(255, 255, 255);
+
+ // button colors
+ --button-text-color: rgb(255, 255, 255);
+ --button-primary-bg-color: rgb(78, 154, 6);
+ --button-secondary-bg-color: rgba(255, 255, 255, 0.09);
+ --button-warning-bg-color: rgb(204, 0, 0);
+
+ // input colors
+ --checkbox-text-color: rgb(255, 255, 255);
+ --checkbox-bg-color: rgb(78, 154, 6);
+ --checkbox-check-color: rgb(255, 255, 255);
+
+ // dropdown colors
+ --dropdown-text-color: rgb(211, 215, 207);
+ --dropdown-error-color: rgb(229, 77, 46);
+ --dropdown-focus-color: rgb(78, 154, 6);
+
+ // textfield colors
+ --textfield-focused-border-color: rgb(78, 154, 6);
+ --textfield-error-border-color: rgb(229, 77, 46);
+ --textfield-label-color: rgb(195, 200, 194);
+ --textfield-text-color: rgb(255, 255, 255);
+
+ // toggle colors
+ --toggle-bg-color: rgb(51, 51, 51);
+ --toggle-thumb-color: rgb(211, 215, 207);
+ --toggle-checked-bg-color: rgb(78, 154, 6);
+
+ // cmdstrcode colors
+ --cmdstrcode-bg-color: rgb(0, 0, 0);
+ --cmdstrcode-text-color: rgb(211, 215, 207);
+
+ // markdown colors
+ --markdown-bg-color: rgb(35, 35, 35);
+ --markdown-outline-color: rgb(78, 154, 6);
+
+ // status(remote) colors
+ // todo: all status colors must be unified
+ --status-connected-color: rgb(70, 167, 88);
+ --status-connecting-color: rgb(245, 217, 10);
+ --status-error-color: rgb(229, 77, 46);
+ --status-disconnected-color: rgb(195, 200, 194);
+
+ // status indicator colors
+ // todo: all status colors must be unified
+ --status-indicator-color: rgb(211, 215, 207);
+ --status-indicator-error: rgb(204, 0, 0);
+ --status-indicator-success: rgb(78, 154, 6);
+
+ // status(version) colors
+ // todo: all status colors must be unified
+ --status-outdated-color: rgb(196, 160, 0);
+ --status-updated-color: rgb(78, 154, 6);
+
+ // term status colors
+ // todo: all status colors must be unified
+ --term-error-color: rgb(204, 0, 0);
+ --term-warning-color: rgb(196, 160, 0);
+
+ // hotkey colors
+ --hotkey-text-color: rgb(195, 200, 194);
+
+ // sidebar colors
+ --sidebar-dev-bg-color: rgb(21, 23, 48);
+ --sidebar-settings-color: rgb(255, 255, 255);
+
+ // line colors
+ --line-sidebar-message-color: rgb(196, 160, 0);
+ --line-background: rgba(21, 23, 21, 1);
+ --line-avatar-color: #eceeec;
+ --line-text-color: rgb(211, 215, 207);
+ --line-svg-fill-color: rgb(150, 152, 150);
+ --line-svg-hover-fill-color: #eceeec;
+ --line-selected-border-color: rgb(193, 195, 193);
+ --line-separator-color: rgb(126, 126, 126);
+ --line-meta-line1-color: rgb(150, 152, 150);
+ --line-error-color: #cc0000;
+ --line-warning-color: #ffa500;
+ --line-base-soft-blue-color: #729fcf;
+ --line-active-border-color: rgb(97, 158, 72);
+ --line-selected-bg-color: rgba(255, 255, 255, 0.1);
+ --line-selected-border-left-color: #ccc;
+ --line-selected-error-border-color: rgba(204, 0, 0, 0.8);
+ --line-selected-error-bg-color: rgb(19, 4, 3);
+ --line-error-bg-color: rgba(200, 0, 0, 0.1);
+ --line-error-border-left-color: rgba(204, 0, 0, 0.8);
+ --line-simple-text-color: rgba(236, 238, 236, 0.6);
+ --line-meta-text-color: rgb(139, 145, 138);
+ --line-meta-user-color: rgba(140, 184, 232);
+ --line-svg-color: rgba(236, 238, 236, 0.6);
+ --line-svg-hover-color: rgba(236, 238, 236, 1);
+ --line-status-success-fill: rgb(88, 193, 66);
+ --line-status-error-fill: #cc0000;
+ --line-status-warning-fill: #ffa500;
+
+ // view colors
+ // todo: bookmarks is a view, colors must be unified with --view* colors
+ --bookmarks-text-color: rgb(211, 215, 207);
+ --bookmarks-textarea-bg-color: rgb(0, 0, 0);
+ --bookmarks-disabled-text-color: rgb(173, 173, 173);
+ --bookmarks-control-hover-color: rgb(255, 255, 255);
+
+ // view colors
+ --view-error-color: rgb(204, 0, 0);
+ --view-text-color: rgb(195, 200, 194);
+
+ // session colors
+ --session-bg-color: rgba(13, 13, 13, 0.85);
+
+ // cmdinput colors
+ --cmdinput-textarea-bg-color: #171717;
+ --cmdinput-text-error-color: rgb(239, 41, 41);
+ --cmdinput-history-title-color: rgb(114, 159, 207);
+ --cmdinput-remote-title-color: rgb(6, 152, 154);
+ --cmdinput-history-item-error-color: rgb(220, 119, 118);
+ --cmdinput-history-item-selected-error-color: rgb(247, 148, 148);
+ --cmdinput-remote-field-control-color: rgb(0, 0, 0);
+ --cmdinput-warning-color: rgb(255, 165, 0);
+ --cmdinput-button-bg-color: rgb(88, 193, 66);
+ --cmdinput-comment-button-bg-color: rgb(57, 113, 255);
+ --cmdinput-disabled-icon-color: rgb(76, 81, 75, 1);
+ --cmdinput-history-bg-color: rgb(21, 23, 21, 1);
+
+ // screen view color
+ --screen-view-text-caption-color: rgb(139, 145, 138);
+}
diff --git a/src/app/sidebar/sidebar.less b/src/app/sidebar/sidebar.less
index d548bc447..b15666ea8 100644
--- a/src/app/sidebar/sidebar.less
+++ b/src/app/sidebar/sidebar.less
@@ -10,6 +10,9 @@
line-height: 20px;
backdrop-filter: blur(4px);
z-index: 20;
+ border-radius: 10px;
+ border-left: 1px solid var(--app-border-color);
+ border-bottom: 1px solid var(--app-border-color);
.title-bar-drag {
-webkit-app-region: drag;
@@ -111,7 +114,7 @@
.separator {
height: 1px;
margin: 16px 0;
- background-color: @base-border;
+ background-color: var(--sidebar-separator-color);
}
.item.workspaces-item {
@@ -120,10 +123,10 @@
.middle {
padding: 4px 6px 8px 6px;
- border-bottom: 1px solid @base-border;
+ border-bottom: 1px solid var(--sidebar-separator-color);
.item {
&.active {
- background: @base-border;
+ background: var(--sidebar-separator-color);
box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.4), 0px 0px 0.5px 0px rgba(0, 0, 0, 0.5),
0px 0px 0.5px 0px rgba(255, 255, 255, 0.5) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.2) inset;
}
@@ -220,127 +223,7 @@
}
}
- .menu-label {
- color: @base-color;
- }
-
- .menu-list {
- li.menu-history,
- li.menu-bookmarks,
- li.menu-settings,
- li.menu-websharing {
- margin-left: -10px;
- }
-
- li.menu-bookmarks {
- margin-left: -10px;
- }
-
- li {
- .hotkey {
- visibility: hidden;
- }
-
- &:hover .hotkey {
- visibility: visible;
- }
- }
- }
-
- .menu-list.session-menu-list {
- li a {
- display: flex;
- flex-direction: row;
- align-items: center;
-
- .session-num {
- width: 24px;
- margin-left: -12px;
- }
-
- .session-gear {
- visibility: hidden;
- }
-
- &:hover .session-gear {
- color: @term-white;
- visibility: visible;
-
- &:hover {
- color: @term-white;
- }
- }
- }
- }
-
- .menu-list.emotes-menu-list {
- max-height: 35%;
- overflow-y: auto;
- }
-
- .menu-list li.emote-menu-item {
- a {
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
-
- .menu-list li a {
- white-space: nowrap;
- padding: 3px 5px 3px 12px;
- vertical-align: middle;
- position: relative;
-
- .user-status {
- position: absolute !important;
- top: 24px !important;
- left: 32px !important;
- }
-
- .avatar {
- width: 24px;
- height: 24px;
- margin-right: 5px;
- vertical-align: middle;
- }
-
- &.is-active .small-text {
- color: @term-white;
- }
-
- &.is-active {
- font-weight: bold;
- background-color: @active-menu-color;
-
- .session-num {
- font-weight: normal;
- }
- }
-
- .sub-label {
- font-style: italic;
- }
-
- &.activity {
- font-weight: bold;
-
- .tag {
- margin-left: 4px;
- padding: 0 5px 0 5px;
- position: relative;
- top: -1px;
- }
- }
-
- .status {
- margin-right: 5px;
- position: relative;
- top: -3px;
- }
- }
-
- .updateBanner {
+ .update-banner {
font-weight: bold;
.icon {
diff --git a/src/app/sidebar/sidebar.tsx b/src/app/sidebar/sidebar.tsx
index a518f3301..d09f1250e 100644
--- a/src/app/sidebar/sidebar.tsx
+++ b/src/app/sidebar/sidebar.tsx
@@ -307,7 +307,7 @@ class MainSideBar extends React.Component
{
}
contents="Update Available"
onClick={() => openLink("https://www.waveterm.dev/download?ref=upgrade")}
diff --git a/src/app/workspace/cmdinput/cmdinput.less b/src/app/workspace/cmdinput/cmdinput.less
index 148bbb384..c0efb79f5 100644
--- a/src/app/workspace/cmdinput/cmdinput.less
+++ b/src/app/workspace/cmdinput/cmdinput.less
@@ -1,25 +1,17 @@
@import "@/common/themes/themes.less";
.cmd-input {
- border-radius: 6px;
max-height: max(300px, 40%);
display: flex;
flex-direction: column;
position: absolute;
- bottom: var(--termfontsize);
- right: var(--termfontsize);
- width: calc(100% - 2 * var(--termfontsize));
+ bottom: 0;
+ width: 100%;
padding: var(--termfontsize);
z-index: 100;
- background: @background-session-components;
- box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.5), 0px 3px 8px 0px rgba(0, 0, 0, 0.35),
- 0px 0px 0.5px 0px rgba(255, 255, 255, 0.5) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.2) inset;
- backdrop-filter: blur(20px);
- border: 1px solid transparent;
+ border-top: 1px solid var(--app-border-color);
&.active {
- border: 1px solid rgba(@wave-green, 0.8) !important;
- box-shadow: 0px 0px 0.5px 0px rgba(255, 255, 255, 0.5) inset, 0px 0.5px 0px 0px rgba(255, 255, 255, 0.2) inset;
}
&.has-info {
@@ -48,7 +40,7 @@
.remote-status-warning {
display: flex;
flex-direction: row;
- color: @term-yellow;
+ color: var(--cmdinput-warning-color);
align-items: center;
.button {
@@ -60,7 +52,7 @@
position: absolute;
top: 5px;
right: 5px;
- color: @term-white;
+ color: var(--app-text-color);
padding: 5px;
cursor: pointer;
@@ -90,11 +82,11 @@
height: 1em;
margin: 0 0.5em;
vertical-align: text-top;
- fill: @base-color;
+ fill: var(--app-text-color);
}
.warning {
- fill: @warning-yellow;
+ fill: var(--cmdinput-warning-color);
}
}
@@ -124,21 +116,21 @@
.shelltag {
position: absolute;
- // 13px = 10px height + 3px padding. subtract termpad to account for textareainput-div padding
- bottom: calc(-13px + var(--termpad));
+ // 13px = 10px height + 3px padding. subtract termpad to account for textareainput-div padding (2px not sure?)
+ bottom: calc(-13px + var(--termpad) + 2px);
right: 0px;
font-size: 10px;
- color: @text-secondary;
+ color: var(--app-text-secondary-color);
line-height: 1;
padding: 0px 8px 3px 8px;
- background-color: @textarea-background;
+ background-color: var(--cmdinput-textarea-bg-color);
border-radius: 0 0 5px 5px;
}
}
textarea {
- color: @term-bright-white;
- background-color: @textarea-background;
+ color: var(--app-text-primary-color);
+ background-color: var(--cmdinput-textarea-bg-color);
padding: var(--termpad);
resize: none;
overflow: auto;
@@ -166,17 +158,17 @@
.cmd-quick-context .button {
background-color: #000 !important;
- color: @term-white;
+ color: var(--app-text-color);
}
&.inputmode-global .cmd-quick-context .button {
- color: @term-black;
- background-color: @tab-green !important;
+ color: var(--app-black);
+ background-color: var(--cmdinput-button-bg-color) !important;
}
&.inputmode-comment .cmd-quick-context .button {
- color: @term-black;
- background-color: @tab-blue !important;
+ color: var(--app-black);
+ background-color: var(--cmdinput-comment-button-bg-color) !important;
}
.cmd-exec {
@@ -189,11 +181,11 @@
height: 2.5em;
cursor: pointer;
border-radius: 50%;
- fill: @wave-green;
+ fill: var(--app-accent-color);
padding: 0.25em;
}
.icon.disabled {
- fill: @disabled-background;
+ fill: var(--cmdinput-disabled-icon-color);
cursor: default;
}
.cmd-btn {
@@ -231,8 +223,8 @@
}
.chat-textarea {
- color: @term-bright-white;
- background-color: @textarea-background;
+ color: var(--app-text-primary-color);
+ background-color: var(--cmdinput-textarea-bg);
padding: 0.5em;
resize: none;
overflow: auto;
@@ -258,7 +250,7 @@
}
.chat-msg-assistant {
- color: @term-white;
+ color: var(--app-text-color);
}
.chat-msg-user {
@@ -270,7 +262,7 @@
}
.chat-msg-error {
- color: @term-bright-red;
+ color: var(--cmdinput-text-error);
font-family: @markdown-font;
font-size: 14px;
}
@@ -281,7 +273,7 @@
}
.cmd-history {
- color: @term-white;
+ color: var(--app-text-color);
margin-bottom: 5px;
overflow: auto;
flex-shrink: 1;
@@ -291,8 +283,8 @@
z-index: 102;
top: 5px;
left: 20px;
- background-color: @background-session-components-solid;
- color: @soft-blue;
+ background-color: var(--cmdinput-history-bg-color);
+ color: var(--cmdinput-history-title-color);
padding-bottom: 4px;
display: flex;
flex-direction: row;
@@ -319,7 +311,7 @@
.history-items {
margin-top: 24px;
- color: @term-white;
+ color: var(--app-text-color);
padding-bottom: 6px;
@@ -328,7 +320,7 @@
}
.history-item.history-haderror {
- color: mix(@term-red, @term-white, 50%);
+ color: var(--cmdinput-history-item-error-color);
}
.history-line:first-child {
@@ -346,12 +338,12 @@
.history-item.is-selected {
font-weight: bold;
- color: @term-bright-white;
+ color: var(--app-text-primary-color);
background-color: #444;
}
.history-item.is-selected.history-haderror {
- color: mix(@term-bright-red, @term-bright-white, 50%);
+ color: var(--cmdinput-history-item-selected-error-color);
}
}
}
@@ -362,21 +354,16 @@
margin-bottom: var(--termpad);
.info-msg {
- color: @soft-blue;
+ color: var(--cmdinput-history-title-color);
padding-bottom: 2px;
a {
- color: @term-blue;
+ color: var(--prompt-blue);
}
}
- .info-title {
- color: @soft-blue;
- padding-bottom: 2px;
- }
-
.info-lines {
- color: @term-white;
+ color: var(--app-text-color);
white-space: pre;
padding-bottom: 6px;
}
@@ -392,7 +379,7 @@
.info-comp {
min-width: 200px;
- color: @term-white;
+ color: var(--app-text-color);
margin-right: 10px;
&.has-space {
@@ -401,19 +388,19 @@
}
.metacmd-comp {
- color: @term-bright-green;
+ color: var(--prompt-bright-green);
}
}
.info-error {
- color: @term-red;
+ color: var(--cmdinput-text-error-color);
padding-bottom: 2px;
}
.info-remote-showall {
table.remotes-table {
th {
- color: @term-white;
+ color: var(--app-text-color);
font-weight: bold;
}
@@ -437,7 +424,7 @@
.info-remote-title {
font-weight: bold;
- color: @term-cyan;
+ color: var(--cmdinput-remote-title-color);
}
.info-error,
@@ -472,7 +459,7 @@
white-space: pre;
width: 140px;
font-weight: bold;
- color: @term-bright-white;
+ color: var(--app-text-primary-color);
}
.undo-icon {
@@ -486,8 +473,8 @@
input[type="text"],
input[type="number"],
input[type="password"] {
- background-color: @term-black;
- color: @term-white;
+ background-color: var(--app-black);
+ color: var(--app-text-color);
width: 200px;
}
}
@@ -502,8 +489,8 @@
&.select-input {
select {
width: 200px;
- background-color: @term-black;
- color: @term-white;
+ background-color: var(--app-black);
+ color: var(--app-text-color);
}
}
}
diff --git a/src/app/workspace/screen/screenview.less b/src/app/workspace/screen/screenview.less
index 9f092f5e1..bee44f259 100644
--- a/src/app/workspace/screen/screenview.less
+++ b/src/app/workspace/screen/screenview.less
@@ -4,6 +4,7 @@
.screen-view {
flex-grow: 1;
position: relative;
+ border-top: 1px solid var(--app-border-color);
}
.screen-sidebar,
@@ -17,19 +18,36 @@
right: 0;
display: flex;
flex-direction: column;
- height: calc(100% - 0.5rem);
+ height: 100%;
overflow: hidden;
- margin-left: 5px;
- padding-left: 5px;
overflow-y: auto;
+ border-left: 1px solid var(--app-border-color);
.sidebar-header {
/* sidebar-header height linked to MagicLayout.ScreenSidebarHeaderHeight */
display: flex;
flex-direction: row;
- padding: 3px 5px;
- border-radius: 3px;
- margin: 3px 5px 0 5px;
+ padding: 3px 0;
+ margin: 0;
+ border-bottom: 1px solid var(--app-border-color);
+ font-size: var(--termfontsize);
+ font-family: var(--termfontfamily);
+ font-weight: normal;
+ line-height: var(--termlineheight);
+ color: var(--screen-view-text-caption-color);
+
+ &:hover {
+ color: white;
+ }
+
+ div.pane-name {
+ visibility: hidden;
+ margin-left: calc(var(--termpad) * 2);
+ }
+
+ &:hover div.pane-name {
+ visibility: visible;
+ }
i {
padding: 3px;
@@ -73,7 +91,7 @@
display: flex;
flex-direction: column;
position: absolute;
- height: calc(100% - 0.5rem);
+ height: 100%;
overflow-x: hidden;
.rendermode-tag {
@@ -81,13 +99,13 @@
top: 0;
right: 0;
background-color: rgba(78, 154, 6, 0.65);
- color: @term-black;
+ color: var(--app-black);
padding: 2px 8px 2px 4px;
border-bottom-left-radius: 5px;
z-index: 10;
&.is-active {
- color: @term-white;
+ color: var(--app-text-color);
}
.render-mode {
@@ -95,10 +113,10 @@
position: relative;
cursor: pointer;
- color: @term-white;
+ color: var(--app-text-color);
&:hover {
- color: @term-white;
+ color: var(--app-text-color);
}
}
}
@@ -124,7 +142,7 @@
}
.share-tag {
- color: @term-white;
+ color: var(--app-text-color);
position: absolute;
top: 0;
left: 40%;
@@ -174,7 +192,7 @@
padding: 1.5em 1em;
margin-top: 0;
line-height: 2.5em;
- border-top: 1px solid @base-border;
+ border-top: 1px solid var(--app-border);
&:first-child {
border-top: none;
}
@@ -222,7 +240,7 @@
}
.cr-help-text {
- color: @text-caption;
+ color: var(--screen-view-text-caption-color);
margin-left: 5px;
}
@@ -310,17 +328,17 @@
height: 16px;
path {
- fill: @text-primary;
+ fill: var(--app-text-primary-color);
}
}
}
.text-standard {
- color: @text-secondary;
+ color: var(--app-text-secondary-color);
}
.text-caption {
- color: @text-caption;
+ color: var(--screen-view-text-caption-color);
}
.ellipsis {
diff --git a/src/app/workspace/screen/screenview.tsx b/src/app/workspace/screen/screenview.tsx
index 7cb8dc807..2cf386256 100644
--- a/src/app/workspace/screen/screenview.tsx
+++ b/src/app/workspace/screen/screenview.tsx
@@ -300,6 +300,7 @@ class ScreenSidebar extends React.Component<{ screen: Screen; width: string }, {
return (
+
sidebar
@@ -307,8 +308,8 @@ class ScreenSidebar extends React.Component<{ screen: Screen; width: string }, {
-
diff --git a/src/app/workspace/screen/tabs.less b/src/app/workspace/screen/tabs.less
index ba951dc90..e81f6fe79 100644
--- a/src/app/workspace/screen/tabs.less
+++ b/src/app/workspace/screen/tabs.less
@@ -5,10 +5,6 @@
border-top: 1px solid transparent;
font-size: 12.5px;
- &:first-child {
- border-radius: 8px 0px 0px 0px;
- }
-
&.color-green,
&.color-default {
svg.svg-icon-inner path {
diff --git a/src/app/workspace/workspace.less b/src/app/workspace/workspace.less
index 3ae9c0f5f..3fcb5f359 100644
--- a/src/app/workspace/workspace.less
+++ b/src/app/workspace/workspace.less
@@ -8,12 +8,12 @@
&.is-hidden {
display: none;
}
- background: @background-session;
- border: 1px solid @base-border;
- border-radius: 8px;
- // transition: width 0.2s ease;
- margin-bottom: 0.5em;
- margin-right: 0.5em;
+ border-radius: 10px;
+ border-radius: 0 0 6px 6px;
+ border-bottom: 1px solid var(--app-border-color);
+ border-right: 1px solid var(--app-border-color);
+ border-left: 1px solid var(--app-border-color);
+ background-color: black;
.center-message {
display: flex;
@@ -21,6 +21,6 @@
justify-content: center;
height: 100%;
width: 100%;
- color: @text-secondary;
+ color: var(--app-text-secondary-color);
}
}
diff --git a/src/app/workspace/workspaceview.tsx b/src/app/workspace/workspaceview.tsx
index 6e811091a..80f53d9d8 100644
--- a/src/app/workspace/workspaceview.tsx
+++ b/src/app/workspace/workspaceview.tsx
@@ -36,7 +36,6 @@ class WorkspaceView extends React.Component<{}, {}> {
if (cmdInputHeight == 0) {
cmdInputHeight = MagicLayout.CmdInputHeight; // this is the base size of cmdInput (measured using devtools)
}
- cmdInputHeight += MagicLayout.CmdInputBottom; // reference to .cmd-input, bottom: 12px
let isHidden = GlobalModel.activeMainView.get() != "session";
let mainSidebarModel = GlobalModel.mainSidebarModel;
diff --git a/src/models/model.ts b/src/models/model.ts
index 32ebbd106..435493a16 100644
--- a/src/models/model.ts
+++ b/src/models/model.ts
@@ -329,7 +329,7 @@ class Model {
let cdata = this.clientData.get();
let ff = cdata?.feopts?.termfontfamily;
if (ff == null) {
- ff = "JetBrains Mono, monospace";
+ ff = appconst.DefaultTermFontFamily;
}
return ff;
}
@@ -1143,7 +1143,7 @@ class Model {
setClientData(clientData: ClientDataType) {
let newFontFamily = clientData?.feopts?.termfontfamily;
if (newFontFamily == null) {
- newFontFamily = "JetBrains Mono";
+ newFontFamily = appconst.DefaultTermFontFamily;
}
let newFontSize = clientData?.feopts?.termfontsize;
if (newFontSize == null) {
diff --git a/src/plugins/code/code.less b/src/plugins/code/code.less
index e534e3f8b..cd9d31552 100644
--- a/src/plugins/code/code.less
+++ b/src/plugins/code/code.less
@@ -4,7 +4,7 @@
.monaco-editor {
.monaco-editor-background,
.margin-view-overlays {
- background-color: @base-background !important;
+ background-color: black !important;
}
.scrollbar {
height: 4px !important;
@@ -16,7 +16,6 @@
}
.buttonContainer {
opacity: 0;
- transition: opacity 0.2s;
position: absolute;
padding: 0.5rem;
right: 0;
@@ -49,7 +48,7 @@
}
}
section {
- transition: height 0.3s ease-in-out;
+ // transition: height 0.3s ease-in-out;
}
.messageContainer {
position: absolute;
diff --git a/src/plugins/code/code.tsx b/src/plugins/code/code.tsx
index 9e5bb5d89..49590140f 100644
--- a/src/plugins/code/code.tsx
+++ b/src/plugins/code/code.tsx
@@ -8,11 +8,24 @@ import { Markdown } from "@/elements";
import { GlobalModel, GlobalCommandRunner } from "@/models";
import Split from "react-split-it";
import loader from "@monaco-editor/loader";
-loader.config({ paths: { vs: "./node_modules/monaco-editor/min/vs" } });
import { checkKeyPressed, adaptFromReactOrNativeKeyEvent } from "@/util/keyutil";
import "./code.less";
+document.addEventListener("DOMContentLoaded", () => {
+ loader.config({ paths: { vs: "./node_modules/monaco-editor/min/vs" } });
+ loader.init().then(() => {
+ monaco.editor.defineTheme("wave-theme", {
+ base: "hc-black",
+ inherit: true,
+ rules: [],
+ colors: {
+ "editor.background": "#000000",
+ },
+ });
+ });
+});
+
function renderCmdText(text: string): any {
return ⌘{text};
}
@@ -330,7 +343,7 @@ class SourceCodeRenderer extends React.Component<
{this.state.showReadonly &&
{"read-only"}
}
this.terminal._core.viewport.syncScrollArea(true), 0);
+ setTimeout(() => this.terminal?._core?.viewport?.syncScrollArea(true), 0);
}
disconnectElem() {
diff --git a/src/util/util.ts b/src/util/util.ts
index 33e2a863e..c459f5133 100644
--- a/src/util/util.ts
+++ b/src/util/util.ts
@@ -334,10 +334,7 @@ function loadFonts(termFont: string) {
if (termFont == "Hack") {
loadHackFont();
}
- document.documentElement.style.setProperty(
- "--termfontfamily",
- '"' + termFont + '"' + ', "JetBrains Mono", monospace'
- );
+ document.documentElement.style.setProperty("--termfontfamily", '"' + termFont + '"');
}
const DOW_STRS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
diff --git a/version.js b/version.js
index a719391eb..1884c00bd 100644
--- a/version.js
+++ b/version.js
@@ -1,2 +1,5 @@
-const VERSION = "v0.6.1";
+const path = require("path");
+const packageJson = require(path.resolve(__dirname, "package.json"));
+
+const VERSION = `${packageJson.version}`;
module.exports = VERSION;
diff --git a/versionmeta.json b/versionmeta.json
deleted file mode 100644
index a24fc53a1..000000000
--- a/versionmeta.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "packages": [
- {
- "type": "dmg",
- "arch": "macos-arm64",
- "channel": "stable",
- "updated": "2023-10-31",
- "version": "v0.4.0",
- "sha": "016876cf3e9fb600d6798891c8566a7ac5d1446a",
- "url": "https://www.getprompt.dev/download/prompt-macos-arm64-v0.4.0.dmg"
- },
- {
- "type": "dmg",
- "arch": "macos-amd64",
- "channel": "stable",
- "updated": "2023-10-31",
- "version": "v0.4.0",
- "sha": "d0bc280e4630a716126e47e700d8d4364db966e6",
- "url": "https://www.getprompt.dev/download/prompt-macos-x86-v0.4.0.dmg"
- }
- ]
-}
diff --git a/wavesrv/cmd/main-server.go b/wavesrv/cmd/main-server.go
index 8fbc23d0d..db9b38b9c 100644
--- a/wavesrv/cmd/main-server.go
+++ b/wavesrv/cmd/main-server.go
@@ -66,10 +66,13 @@ const TelemetryInterval = 8 * time.Hour
const MaxWriteFileMemSize = 20 * (1024 * 1024) // 20M
+// these are set at build time
+var WaveVersion = "v0.0.0"
+var BuildTime = "0"
+
var GlobalLock = &sync.Mutex{}
var WSStateMap = make(map[string]*scws.WSState) // clientid -> WsState
var GlobalAuthKey string
-var BuildTime = "0"
var shutdownOnce sync.Once
var ContentTypeHeaderValidRe = regexp.MustCompile(`^\w+/[\w.+-]+$`)
@@ -804,6 +807,7 @@ func doShutdown(reason string) {
func main() {
scbase.BuildTime = BuildTime
+ scbase.WaveVersion = WaveVersion
base.ProcessType = base.ProcessType_WaveSrv
wlog.GlobalSubsystem = base.ProcessType_WaveSrv
wlog.LogConsumer = wlog.LogWithLogger
diff --git a/wavesrv/pkg/cmdrunner/cmdrunner.go b/wavesrv/pkg/cmdrunner/cmdrunner.go
index 387b0ca34..6dfbcc9a1 100644
--- a/wavesrv/pkg/cmdrunner/cmdrunner.go
+++ b/wavesrv/pkg/cmdrunner/cmdrunner.go
@@ -16,6 +16,7 @@ import (
"os"
"path/filepath"
"regexp"
+ "runtime"
"sort"
"strconv"
"strings"
@@ -2585,13 +2586,18 @@ func updateAsstResponseAndWriteToUpdateBus(ctx context.Context, cmd *sstore.CmdT
scbus.MainUpdateBus.DoScreenUpdate(cmd.ScreenId, update)
}
-func getCmdInfoEngineeredPrompt(userQuery string, curLineStr string) string {
- rtn := "You are an expert on the command line terminal. Your task is to help me write a command."
- if curLineStr != "" {
- rtn += "My current command is: " + curLineStr
+func getCmdInfoEngineeredPrompt(userQuery string, curLineStr string, shellType string, osType string) string {
+ promptBase := "You are an AI assistant with deep expertise in command line interfaces, CLI programs, and shell scripting. Your task is to help the user to fix an existing command that will be provided, or if no command is provided, help write a new command that the user requires. Feel free to provide appropriate context, but try to keep your answers short and to the point as the user is asking for help because they are trying to get a task done immediately."
+ promptBase = promptBase + " The user is current using the \"" + shellType + "\" shell on " + osType + "."
+ promptCurrentCommand := ""
+ if strings.TrimSpace(curLineStr) != "" {
+ // Enclose the command in triple backticks to format it as a code block.
+ promptCurrentCommand = " The user is currently working with the command: ```\n" + curLineStr + "\n```\n\n"
}
- rtn += ". My question is: " + userQuery + "."
- return rtn
+ promptFormattingInstruction := "Please ensure any command line suggestions or code snippets that are meant to be run by the user are enclosed in triple backquotes for easy copy and paste into the terminal."
+ promptQuestion := " The user's question is:\n\n" + userQuery + ""
+
+ return promptBase + promptCurrentCommand + promptFormattingInstruction + promptQuestion
}
func doOpenAICmdInfoCompletion(cmd *sstore.CmdType, clientId string, opts *sstore.OpenAIOptsType, prompt []packet.OpenAIPromptMessageType, curLineStr string) {
@@ -2641,7 +2647,6 @@ func doOpenAICmdInfoCompletion(cmd *sstore.CmdType, clientId string, opts *sstor
doneWaitingForPackets = true
asstOutputPk.Error = "timeout waiting for server response"
updateAsstResponseAndWriteToUpdateBus(ctx, cmd, asstMessagePk, asstOutputMessageID)
- break
case pk, ok := <-ch:
if ok {
// got a packet
@@ -2667,11 +2672,9 @@ func doOpenAICmdInfoCompletion(cmd *sstore.CmdType, clientId string, opts *sstor
}
asstMessagePk.AssistantResponse = asstOutputPk
updateAsstResponseAndWriteToUpdateBus(ctx, cmd, asstMessagePk, asstOutputMessageID)
-
} else {
// channel closed
doneWaitingForPackets = true
- break
}
}
}
@@ -2739,7 +2742,6 @@ func doOpenAIStreamCompletion(cmd *sstore.CmdType, clientId string, opts *sstore
return
}
doneWaitingForPackets = true
- break
case pk, ok := <-ch:
if ok {
// got a packet
@@ -2755,7 +2757,6 @@ func doOpenAIStreamCompletion(cmd *sstore.CmdType, clientId string, opts *sstore
} else {
// channel closed
doneWaitingForPackets = true
- break
}
}
}
@@ -2779,6 +2780,14 @@ func BuildOpenAIPromptArrayWithContext(messages []*packet.OpenAICmdInfoChatMessa
return rtn
}
+func GetOsTypeFromRuntime() string {
+ osVal := runtime.GOOS
+ if osVal == "darwin" {
+ osVal = "macos"
+ }
+ return osVal
+}
+
func OpenAICommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (scbus.UpdatePacket, error) {
ids, err := resolveUiIds(ctx, pk, R_Session|R_Screen)
if err != nil {
@@ -2825,7 +2834,8 @@ func OpenAICommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (scbus
}
curLineStr := defaultStr(pk.Kwargs["curline"], "")
userQueryPk := &packet.OpenAICmdInfoChatMessage{UserQuery: promptStr, MessageID: sstore.ScreenMemGetCmdInfoMessageCount(cmd.ScreenId)}
- engineeredQuery := getCmdInfoEngineeredPrompt(promptStr, curLineStr)
+ osType := GetOsTypeFromRuntime()
+ engineeredQuery := getCmdInfoEngineeredPrompt(promptStr, curLineStr, ids.Remote.ShellType, osType)
userQueryPk.UserEngineeredQuery = engineeredQuery
writePacketToUpdateBus(ctx, cmd, userQueryPk)
prompt := BuildOpenAIPromptArrayWithContext(sstore.ScreenMemGetCmdInfoChat(cmd.ScreenId).Messages)
diff --git a/wavesrv/pkg/scbase/scbase.go b/wavesrv/pkg/scbase/scbase.go
index bc9ab45ba..3bc397156 100644
--- a/wavesrv/pkg/scbase/scbase.go
+++ b/wavesrv/pkg/scbase/scbase.go
@@ -35,14 +35,16 @@ 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.1"
const WaveAuthKeyFileName = "waveterm.authkey"
const MShellVersion = "v0.4.0"
var SessionDirCache = make(map[string]string)
var ScreenDirCache = make(map[string]string)
var BaseLock = &sync.Mutex{}
+
+// these are set by the main-server using build-time variables
var BuildTime = "-"
+var WaveVersion = "-"
func IsDevMode() bool {
pdev := os.Getenv(WaveDevVarName)