Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions registry/anomaly/modules/tmux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ up a default or custom tmux configuration with session save/restore capabilities
```tf
module "tmux" {
source = "registry.coder.com/anomaly/tmux/coder"
version = "1.0.3"
version = "1.0.4"
agent_id = coder_agent.example.id
}
```
Expand All @@ -39,7 +39,7 @@ module "tmux" {
```tf
module "tmux" {
source = "registry.coder.com/anomaly/tmux/coder"
version = "1.0.3"
version = "1.0.4"
agent_id = coder_agent.example.id
tmux_config = "" # Optional: custom tmux.conf content
save_interval = 1 # Optional: save interval in minutes
Expand Down Expand Up @@ -78,7 +78,7 @@ This module can provision multiple tmux sessions, each as a separate app in the
```tf
module "tmux" {
source = "registry.coder.com/anomaly/tmux/coder"
version = "1.0.3"
version = "1.0.4"
agent_id = var.agent_id
sessions = ["default", "dev", "anomaly"]
tmux_config = <<-EOT
Expand Down
2 changes: 1 addition & 1 deletion registry/anomaly/modules/tmux/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ resource "coder_script" "tmux" {
display_name = "tmux"
icon = "/icon/terminal.svg"
script = templatefile("${path.module}/scripts/run.sh", {
TMUX_CONFIG = var.tmux_config
TMUX_CONFIG = base64encode(var.tmux_config)
SAVE_INTERVAL = var.save_interval
})
run_on_start = true
Expand Down
4 changes: 2 additions & 2 deletions registry/anomaly/modules/tmux/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BOLD='\033[0;1m'

# Convert templated variables to shell variables
SAVE_INTERVAL="${SAVE_INTERVAL}"
TMUX_CONFIG="${TMUX_CONFIG}"
TMUX_CONFIG=$(echo -n "${TMUX_CONFIG}" | base64 -d)

# Function to install tmux
install_tmux() {
Expand Down Expand Up @@ -73,7 +73,7 @@ setup_tmux_config() {
mkdir -p "$config_dir"

if [ -n "$TMUX_CONFIG" ]; then
printf "$TMUX_CONFIG" > "$config_file"
printf "%s" "$TMUX_CONFIG" > "$config_file"
printf "$${BOLD}Custom tmux configuration applied at {$config_file} \n\n"
else
cat > "$config_file" << EOF
Expand Down