Skip to content

Commit 8534e00

Browse files
authored
Merge pull request #23 from stuartleeks/sl/docs
Add Windows Terminal and completion info
2 parents e8b29f8 + a22d11d commit 8534e00

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ sudo -E ./install.sh
2525
To enable bash completion, add the following to you `~/.bashrc` file:
2626

2727
```bash
28-
. <(devcontainer completion bash)
28+
source <(devcontainer completion bash)
29+
```
30+
31+
Or to alias `devcontainer` (to `dc` in this example):
32+
33+
```bash
34+
alias dc=devcontainer
35+
source <(devcontainer completion bash | sed s/devcontainer/dc/g)
2936
```
3037

3138
## Usage
@@ -60,6 +67,16 @@ Specify the devcontainer to use:
6067
0
6168
```
6269

70+
You can use this with Windows Terminal profiles:
71+
72+
```json
73+
{
74+
"guid": "{4b304185-99d2-493c-940c-ae74e0f14bba}",
75+
"hidden": false,
76+
"name": "devcontainer exec",
77+
"commandline": "wsl bash -c \"path/to/devcontainer exec ? bash\"",
78+
},
79+
```
6380

6481
### Working with devcontainer templates
6582

cmd/devcontainer/completion.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ func createCompleteCommand(rootCmd *cobra.Command) *cobra.Command {
2121
For example, to configure your bash shell to load completions for each session add to your bashrc
2222
2323
# ~/.bashrc or ~/.profile
24-
. <(devcontainer completion)
24+
source <(devcontainer completion)
25+
26+
# if you want to alias the CLI:
27+
alias dc=devcontainer
28+
source <(devcontainer completion bash | sed s/devcontainer/dc/g)
29+
2530
`,
2631
RunE: func(cmd *cobra.Command, args []string) error {
2732
if len(args) != 1 {

0 commit comments

Comments
 (0)