@lvce-editor/pty-host 0.16.18 → 0.16.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/pty-host",
3
- "version": "0.16.18",
3
+ "version": "0.16.20",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -9,6 +9,7 @@ export const commandMap = {
9
9
  [TerminalProcessCommandType.HandleNodeMessagePort]: HandleNodeMessagePort.handleNodeMessagePort,
10
10
  [TerminalProcessCommandType.HandleWebSocket]: HandleWebSocket.handleWebSocket,
11
11
  [TerminalProcessCommandType.TerminalCreate]: PtyController.create,
12
+ [TerminalProcessCommandType.TerminalResize]: PtyController.resize,
12
13
  [TerminalProcessCommandType.TerminalWrite]: PtyController.write,
13
14
  [TerminalProcessCommandType.TerminalDispose]: PtyController.dispose,
14
15
  }
@@ -34,6 +34,14 @@ export const write = (id, data) => {
34
34
  Pty.write(pty, data)
35
35
  }
36
36
 
37
+ export const resize = (id, columns, rows) => {
38
+ const pty = state.ptyMap[id]
39
+ if (!pty) {
40
+ throw new Error(`pty ${id} not found`)
41
+ }
42
+ Pty.resize(pty, columns, rows)
43
+ }
44
+
37
45
  export const dispose = (id) => {
38
46
  const { ptyMap } = state
39
47
  const pty = ptyMap[id]
@@ -2,5 +2,6 @@ export const HandleElectronMessagePort = 'HandleElectronMessagePort.handleElectr
2
2
  export const HandleNodeMessagePort = 'HandleNodeMessagePort.handleNodeMessagePort'
3
3
  export const HandleWebSocket = 'HandleWebSocket.handleWebSocket'
4
4
  export const TerminalCreate = 'Terminal.create'
5
+ export const TerminalResize = 'Terminal.resize'
5
6
  export const TerminalWrite = 'Terminal.write'
6
7
  export const TerminalDispose = 'Terminal.dispose'