You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
save_interval = 1 # Optional: save interval in minutes
37
+
sessions = ["default", "dev", "ops"] # Optional: list of tmux sessions
38
+
order = 1 # Optional: UI order
39
+
group = "Terminal" # Optional: UI group
40
+
icon = "/icon/tmux.svg" # Optional: app icon
37
41
}
38
42
```
39
43
44
+
## Multi-Session Support
45
+
46
+
This module can provision multiple tmux sessions, each as a separate app in the Coder UI. Use the `sessions` variable to specify a list of session names. For each session, a `coder_app` is created, allowing you to launch or attach to that session directly from the UI.
47
+
48
+
-**sessions**: List of tmux session names (default: `["default"]`).
49
+
40
50
## How It Works
41
51
42
52
-**tmux Installation:**
@@ -58,19 +68,24 @@ module "tmux" {
58
68
59
69
```tf
60
70
module "tmux" {
61
-
source = "./registry/anomaly/modules/tmux"
62
-
agent_id = var.agent_id
63
-
tmux_config = <<-EOT
71
+
source = "./registry/anomaly/modules/tmux"
72
+
agent_id = var.agent_id
73
+
sessions = ["default", "dev", "anomaly"]
74
+
tmux_config = <<-EOT
64
75
set -g mouse on
65
76
set -g history-limit 10000
66
77
EOT
78
+
group = "Terminal"
79
+
order = 2
67
80
}
68
81
```
69
82
70
83
> [!NOTE]
84
+
>
71
85
> - If you provide a custom `tmux_config`, it will completely replace the default configuration. Ensure you include plugin
72
-
and TPM initialization lines if you want plugin support.
86
+
> and TPM initialization lines if you want plugin support and session persistence.
73
87
> - The script will attempt to install dependencies using `sudo` where required.
74
88
> - If `git` is not installed, TPM installation will fail.
75
-
> - To restore in case of server restart `prefix + ctrl+r`
76
-
> - If you are using custom config, you'll be responsible for setting up persistence
89
+
> - If you are using custom config, you'll be responsible for setting up persistence and plugins.
90
+
> - The `order`, `group`, and `icon` variables allow you to customize how tmux apps appear in the Coder UI.
91
+
> - In case of session restart or shh reconnection, the tmux session will be automatically restored :)
0 commit comments