@electerm/electerm-react 1.100.18 → 1.100.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -145,9 +145,19 @@ export default class QuickCommandsList extends List {
145
145
  const f = keyword
146
146
  ? list.filter((item) => {
147
147
  const n = (item.name || '').toLowerCase()
148
- const c = (item.command || '').toLowerCase()
149
148
  const k = keyword.toLowerCase()
150
- return n.includes(k) || c.includes(k)
149
+
150
+ // Check if item has commands array
151
+ if (item.commands && Array.isArray(item.commands)) {
152
+ // Search in each command in the commands array
153
+ return n.includes(k) || item.commands.some(cmd =>
154
+ (cmd.command || '').toLowerCase().includes(k)
155
+ )
156
+ } else {
157
+ // Fallback to the old behavior for backward compatibility
158
+ const c = (item.command || '').toLowerCase()
159
+ return n.includes(k) || c.includes(k)
160
+ }
151
161
  })
152
162
  : list
153
163
  return labels.length
@@ -46,8 +46,8 @@ export const getLocalFileInfo = async (filePath) => {
46
46
  const stat = await fs.lstatAsync(filePath)
47
47
  return {
48
48
  size: stat.size,
49
- accessTime: stat.atime,
50
- modifyTime: stat.mtime,
49
+ accessTime: stat.atime || stat.atimeMs,
50
+ modifyTime: stat.mtime || stat.mtimeMs,
51
51
  mode: stat.mode,
52
52
  owner: stat.uid,
53
53
  group: stat.gid,
@@ -81,17 +81,22 @@ export async function addTabFromCommandLine (store, opts) {
81
81
  const opts = safeParse(options.opts)
82
82
  if (opts !== options.opts) {
83
83
  Object.assign(update, opts)
84
+ update.fromCmdLine = true
84
85
  }
85
86
  }
86
- if (options.type) {
87
- update.type = options.type
87
+ if (options.tp) {
88
+ update.type = options.tp
89
+ update.fromCmdLine = true
88
90
  }
89
91
  Object.assign(conf, update)
90
92
  if (options.privateKeyPath) {
91
93
  conf.privateKey = await fs.readFile(options.privateKeyPath)
92
94
  }
93
95
  log.debug('command line opts', conf)
94
- if (conf.username && conf.host) {
96
+ if (
97
+ (conf.username && conf.host) ||
98
+ conf.fromCmdLine
99
+ ) {
95
100
  store.addTab(conf)
96
101
  } else if (
97
102
  options.initFolder &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.100.18",
3
+ "version": "1.100.20",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",