Skip to content

Commit 8e0b3a9

Browse files
authored
Merge pull request MayDay-wpf#130 from yecechi/vsix
feat(vsix): 增强sidebar终端稳定性,新增路径添加/发送能力
2 parents 6cf7882 + da5ea9b commit 8e0b3a9

7 files changed

Lines changed: 1504 additions & 1135 deletions

File tree

VSIX/package.json

Lines changed: 46 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,36 @@
127127
"title": "Restart Terminal",
128128
"icon": "$(debug-rerun)"
129129
},
130+
{
131+
"command": "snow-cli.addFolderPath",
132+
"title": "Add Folder Path",
133+
"icon": "$(file-symlink-directory)"
134+
},
135+
{
136+
"command": "snow-cli.addFilePath",
137+
"title": "Add File Path",
138+
"icon": "$(file-symlink-file)"
139+
},
130140
{
131141
"command": "snow-cli.openSnowSettings",
132142
"title": "Snow CLI Settings",
133143
"icon": "$(settings-gear)"
134144
},
135-
{
136-
"command": "snow-cli.openFilePicker",
137-
"title": "Insert File Path",
138-
"icon": "$(file-directory)"
139-
},
140145
{
141146
"command": "snow-cli.focusSidebar",
142147
"title": "Focus Snow CLI Sidebar"
148+
},
149+
{
150+
"command": "snow-cli.sendFilePaths",
151+
"title": "Send to Snow CLI",
152+
"icon": "$(file-symlink-file)"
153+
}
154+
],
155+
"submenus": [
156+
{
157+
"id": "snow-cli.insertPathActions",
158+
"label": "Insert Path",
159+
"icon": "$(attach)"
143160
}
144161
],
145162
"keybindings": [
@@ -168,10 +185,33 @@
168185
"group": "navigation@2"
169186
},
170187
{
171-
"command": "snow-cli.openFilePicker",
188+
"submenu": "snow-cli.insertPathActions",
172189
"when": "view == snowCliTerminal && snow-cli.sidebarMode",
173190
"group": "navigation@3"
174191
}
192+
],
193+
"snow-cli.insertPathActions": [
194+
{
195+
"command": "snow-cli.addFolderPath",
196+
"group": "navigation@1"
197+
},
198+
{
199+
"command": "snow-cli.addFilePath",
200+
"group": "navigation@2"
201+
}
202+
],
203+
"explorer/context": [
204+
{
205+
"command": "snow-cli.sendFilePaths",
206+
"group": "snow@1"
207+
}
208+
],
209+
"editor/title/context": [
210+
{
211+
"command": "snow-cli.sendFilePaths",
212+
"when": "resourceScheme == file || resourceScheme == vscode-remote",
213+
"group": "snow@1"
214+
}
175215
]
176216
}
177217
},

VSIX/res/sidebarTerminal.css

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
:root {
2+
--terminal-bg: #181818;
3+
--terminal-drag-outline: #007acc;
4+
--terminal-error: #f14c4c;
5+
--terminal-border: var(--vscode-panel-border, rgba(255, 255, 255, 0.12));
6+
}
7+
8+
* {
9+
margin: 0;
10+
padding: 0;
11+
box-sizing: border-box;
12+
}
13+
14+
html,
15+
body,
16+
#terminal-container,
17+
.xterm {
18+
height: 100%;
19+
width: 100%;
20+
}
21+
22+
html,
23+
body {
24+
overflow: hidden;
25+
background-color: var(--terminal-bg);
26+
}
27+
28+
#terminal-container.drag-over {
29+
outline: 2px dashed var(--terminal-drag-outline);
30+
outline-offset: -2px;
31+
}
32+
33+
#terminal-container.terminal-error {
34+
color: var(--terminal-error);
35+
padding: 20px;
36+
font-family: monospace;
37+
font-size: 12px;
38+
white-space: pre-wrap;
39+
}
40+
41+
.xterm .xterm-viewport,
42+
.xterm .xterm-scrollable-element {
43+
background-color: var(--terminal-bg) !important;
44+
}
45+
46+
.xterm .xterm-scrollable-element {
47+
height: 100%;
48+
}
49+
50+
.xterm .xterm-scrollable-element > .scrollbar.vertical {
51+
box-sizing: border-box;
52+
border-left: 1px solid var(--terminal-border);
53+
}
54+
55+
.xterm .xterm-scrollable-element > .scrollbar.horizontal {
56+
box-sizing: border-box;
57+
border-top: 1px solid var(--terminal-border);
58+
}

0 commit comments

Comments
 (0)