1
1
# command-server README
2
2
3
- Adds support for running arbitrary commands via file-based RPC. Designed for
3
+ Adds support for running arbitrary commands via file-based RPC. Designed for
4
4
use with voice-control systems such as [ Talon] ( https://talonvoice.com/ ) .
5
5
6
6
## Features
7
7
8
8
On startup, creates a directory in the default tmp directory, called
9
- ` vscode-command-server-${userName} ` , where ` ${userName} ` is the username. Then
9
+ ` vscode-command-server-${userName} ` , where ` ${userName} ` is the username. Then
10
10
waits for the ` command-server.runCommand ` command to be issued, which will
11
11
trigger the command server to read the ` request.json ` file in the communication
12
12
directory, execute the command requested there, and write the response to
13
- ` response.json ` . Note that we write the JSON response on a single line, with a
13
+ ` response.json ` . Note that we write the JSON response on a single line, with a
14
14
trailing newline, so that the client can repeatedly try to read the file until
15
15
it finds a final newline to indicate that the write is complete.
16
16
17
17
Note that the command server will refuse to execute a command if the request file is older than 3 seconds.
18
18
19
19
Requests look as follows:
20
+
20
21
``` json
21
22
{
22
23
"commandId" : " some-command-id" ,
23
- "args" : [
24
- " some-argument"
25
- ]
24
+ "args" : [" some-argument" ]
26
25
}
27
26
```
28
27
@@ -43,70 +42,83 @@ Have a look at
43
42
[ talon-vscode-command-client] ( https://github.com/pokey/talon-vscode-command-client ) .
44
43
45
44
## Commands
45
+
46
46
Contributes the following commands:
47
+
47
48
- ` command-server.runCommand ` : Reads from the requests.json file and executes the given command.
48
49
49
50
## Keyboard shortcuts
50
- | Key | Command |
51
- | ---------------------------------------------------------------- | -------------------------------- |
52
- | <kbd >Ctrl</kbd >/<kbd >Cmd</kbd > + <kbd >Shift</kbd > + <kbd >Alt</kbd > + <kbd >P</kbd > | Run command |
51
+
52
+ | Key | Command |
53
+ | ------------------------------------------------------------------ | ----------- |
54
+ | <kbd >Ctrl</kbd >/<kbd >Cmd</kbd > + <kbd >Shift</kbd > + <kbd >F17</kbd > | Run command |
53
55
54
56
## Configuration
57
+
55
58
Contributes the following settings:
56
59
57
60
### ` command-server.allowList `
61
+
58
62
Allows user to specify the allowed commands using glob syntax, eg:
59
63
60
64
``` json
61
65
{
62
- "command-server.allowList" : [" workbench.*" ]
66
+ "command-server.allowList" : [" workbench.*" ]
63
67
}
64
68
```
65
69
66
70
Defaults to ` ["*"] ` (allows everything).
67
71
68
72
### ` command-server.denyList `
73
+
69
74
Allows user to specify the denied commands using glob syntax, eg:
70
75
71
76
``` json
72
77
{
73
- "command-server.denyList" : [" workbench.*" ]
78
+ "command-server.denyList" : [" workbench.*" ]
74
79
}
75
80
```
76
81
77
82
Defaults to ` [] ` (doesn't deny anything).
78
83
79
84
## Troubleshooting
80
85
81
-
82
86
## Known issues
83
87
84
- - The server won't respond until the extension is loaded. This may be obvious,
88
+ - The server won't respond until the extension is loaded. This may be obvious,
85
89
but just be aware that if you have other extensions that take a while to
86
90
load, the server might not respond for a little while after you load an
87
91
editor window until everything is fully loaded.
88
- - There is a very unlikely race condition. If the front VSCode is hung
92
+ - There is a very unlikely race condition. If the front VSCode is hung
89
93
when you issue a command, and then you switch to another VSCode, and issue a
90
94
command, then if the first instance wakes up at the exact right moment it
91
- could execute the command. There is code in the command server that tries to
95
+ could execute the command. There is code in the command server that tries to
92
96
prevent a background window from inadvertently executing a command, but
93
97
VSCode seems to be a bit inconsistent with determining which window has
94
- focus. When this focused window detection fails, it will end up [ preventing
95
- correct commands from running] ( https://github.com/knausj85/knausj_talon/issues/466 ) . Thus, this protection has been disabled by
96
- default, as the scenario it protects against has never been observed in practice. If you do have issues with background windows trying to execute
98
+ focus. When this focused window detection fails, it will end up [ preventing
99
+ correct commands from running] ( https://github.com/knausj85/knausj_talon/issues/466 ) . Thus, this protection has been disabled by
100
+ default, as the scenario it protects against has never been observed in practice. If you do have issues with background windows trying to execute
97
101
commands, please file an issue, and we can look into another way to prevent
98
102
this from occurring.
99
103
100
104
## Release Notes
101
105
106
+ ### 0.7.0
107
+
108
+ - Switch default keybinding
109
+
102
110
### 0.6.0
111
+
103
112
- Add partial support for untrusted workspaces
104
113
105
114
### 0.5.1
115
+
106
116
- Disable background window protection by default.
107
117
108
118
### 0.5.0
119
+
109
120
- Improve robustness, and add ` command-server.backgroundWindowProtection ` setting
110
121
111
122
### 0.4.0
112
- - Switch to file-based RPC
123
+
124
+ - Switch to file-based RPC
0 commit comments