Skip to content

Commit 715c59d

Browse files
committed
fix: missing fig generated spec
1 parent f2fd467 commit 715c59d

File tree

4 files changed

+41
-26
lines changed

4 files changed

+41
-26
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"@types/node-ipc": "^9.2.3",
5555
"@types/shell-quote": "^1.7.5",
5656
"@vitejs/plugin-vue": "^5.2.1",
57-
"@vue-macros/reactivity-transform": "^1.1.6",
57+
"@vue-macros/reactivity-transform": "3.0.0-beta.5",
5858
"@vueuse/core": "^13.0.0",
5959
"@withfig/autocomplete-types": "^1.31.0",
6060
"@xterm/addon-canvas": "^0.7.0",

pnpm-lock.yaml

Lines changed: 31 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/utils/completion.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ async function getFigCompletions(
226226
context: FigContext,
227227
) {
228228
const spec = typeof lazySpec === 'function' ? lazySpec() : lazySpec
229-
if (!('name' in spec)) return []
229+
// FIXME: why does `undefined extends Fig.Spec ? true : false` get `true` ?
230+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
231+
if (!spec || !('name' in spec)) return []
230232
const asyncCompletions: (CommandCompletion[] | Promise<CommandCompletion[]>)[] = []
231233
const options = spec.options ?? []
232234
// Suggestions

src/renderer/utils/shell-integration.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { stripVTControlCharacters } from 'node:util'
12
import type { IDecoration, IDisposable, IMarker, ITerminalAddon, Terminal } from '@xterm/xterm'
23
import fuzzaldrin from 'fuzzaldrin-plus'
34
import { isEqual, sortBy } from 'lodash'
@@ -837,7 +838,11 @@ export class ShellIntegrationAddon implements ITerminalAddon {
837838
}
838839
this.skipCompletion(position)
839840
this.tab.xterm.input('\x7F'.repeat(back))
840-
this.tab.xterm.paste(value)
841+
if (stripVTControlCharacters(value) === value) {
842+
this.tab.xterm.paste(value)
843+
} else {
844+
this.tab.xterm.input(value)
845+
}
841846
// Preload completions
842847
this._getRealtimeCompletions(input.slice(0, -back) + value + ' ')
843848
}

0 commit comments

Comments
 (0)