Skip to content

Commit 410c01c

Browse files
authored
Connections Examples (#1552)
Adds a few examples to the `connections.mdx` file to show: - hiding a connection - re-ordering connections - theming connections - disabling wsh for a connection
1 parent 69bb1d4 commit 410c01c

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

docs/docs/connections.mdx

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,72 @@ In addition to the regular ssh config file, wave also has its own config file to
7676
| term:theme | This string can be used to specify a terminal theme for blocks using this connection. The block metadata takes priority over this setting. It defaults to null which means the global setting will be used instead. |
7777
| ssh:identityfile | A list of strings containing the paths to identity files that will be used. If a `wsh ssh` command using the `-i` flag is successful, the identity file will automatically be added here. |
7878

79+
### Example Internal Configurations
80+
81+
Here are a couple examples of things you can do using the internal configuration file `connections.json`:
82+
83+
#### Hiding a Connection
84+
85+
Suppose you have a connection named `github.com` in your `~/.ssh/config` file that shows up as `[email protected]` in the connections dropdown. While it does belong in the config file for authentication reasons, it makes no sense to be in the dropdown since it doesn't involve connecting to a remote environment. In that case, you can hide it as in the example below:
86+
87+
```json
88+
{
89+
<... other connections go here ...>,
90+
91+
"display:hidden": true
92+
},
93+
<... other connections go here ...>
94+
}
95+
```
96+
97+
#### Moving a Connection
98+
99+
Suppose you have a connection named `rarelyused` that shows up as `myusername@rarelyused:9999` in the connections dropdown. Since it's so rarely used, you would prefer to move it later in the list. In that case, you can move it as in the example below:
100+
101+
```json
102+
{
103+
<... other connections go here ...>,
104+
"myusername@rarelyused:9999" : {
105+
"display:order": 100
106+
},
107+
<... other connections go here ...>
108+
}
109+
```
110+
111+
#### Theming a Connection
112+
113+
Suppose you have a connection named `myhost` that shows up as `myusername@myhost` in the connections dropdown. You use this connection a lot, but you keep getting it mixed up with your local connections. In this case, you can use the internal configuration file to style it differently. For example:
114+
115+
```json
116+
{
117+
<... other connections go here ...>,
118+
"myusername@myhost" : {
119+
"term:theme": "warmyellow",
120+
"term:fontsize": 16,
121+
"term:fontfamily": "menlo"
122+
},
123+
<... other connections go here ...>
124+
}
125+
```
126+
127+
This style, font size, and font family will then only apply to the widgets that are using this connection.
128+
129+
### Disabling Wsh for a Connection
130+
131+
While Wave provides an option disable `wsh` when first connecting to a remote, there are cases where you may wish to disable it afterward. The easiest way to do this is by editing the `connections.json` file. Suppose the connection shows up in the dropdown as `root@wshless`. Then you can disable it manually with the following line:
132+
133+
```json
134+
{
135+
<... other connections go here ...>,
136+
"root@wshless" : {
137+
"conn:enablewsh": false,
138+
},
139+
<... other connections go here ...>
140+
}
141+
```
142+
143+
Note that this same line gets added to your `connections.json` file automatically when you choose to disable `wsh` in gui when initially connecting.
144+
79145
## Managing Connections with the CLI
80146

81147
The `wsh` command gives some commands specifically for interacting with the connections. You can view these [here](/wsh-reference#conn).

0 commit comments

Comments
 (0)