{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreicz2hnszpsz6yuej7sgfzhfm76x3zfzjr746cmxjocylbsdx52ckm",
    "uri": "at://did:plc:5y2ps7xhcqmc2d63b73ui72s/app.bsky.feed.post/3mknojesuejy2"
  },
  "coverImage": {
    "$type": "blob",
    "ref": {
      "$link": "bafkreibpwxpkm5zcog5qsz23ykaq62vm4mw53ijgcbohpio7ohg6opkzky"
    },
    "mimeType": "image/png",
    "size": 1899497
  },
  "description": "Struggling to make tmux settings stick on Home Assistant OS? I found a simple workaround using a custom config file and init script. This guide shows how to persist tmux tweaks like keybindings, plugins, and UI changes on a Home Assistant Yellow.",
  "path": "/making-tmux-settings-permanent-with-home-assistant/",
  "publishedAt": "2026-04-29T18:00:04.000Z",
  "site": "https://blog.php-systems.com",
  "tags": [
    "@plugin"
  ],
  "textContent": "If you’ve ever tried customising `tmux` on Home Assistant OS, you’ll have noticed one frustrating thing: **your changes don’t survive reboots**.\n\n> 💡 **Why this happens**\n>  Home Assistant OS is largely immutable. Many user-level config changes (like `.tmux.conf`) don’t persist or get overwritten during startup.\n\nAfter a fair bit of trial and error, I landed on a simple and reliable workaround.\n\n* * *\n\n## 🧠 The Idea\n\nInstead of fighting the system, let it initialise normally… then patch `tmux` afterward.\n\n> ⚙️ **Approach** Store your custom config in `/config` (persistent)Use a startup script to inject it into `.tmux.conf`\n\n* * *\n\n## 📁 Step 1: Create a Persistent Tmux Config\n\nCreate the file `/config/tmux_additional.conf` with the following content:\n\n\n    # Change Bind Keys\n    set -g prefix C-a\n    unbind-key C-b\n    bind-key C-a send-prefix\n\n    # Change bottom of the screenbar colours\n    set -g status-style \"fg=white,bg=blue\"\n\n    # Basic Settings\n    #set-option -g mouse on           # Enable mouse support\n    set-option -g history-limit 10000 # Increase scrollback buffer\n    set-option -g escape-time 0      # Reduce escape delay\n\n    # Tmux Plugin Manager (TPM) setup\n    set -g @plugin 'tmux-plugins/tpm'\n    set -g @plugin 'tmux-plugins/tmux-sensible' # Sensible defaults\n\n    # Initialize TPM (add at the very end of the file)\n    run-shell \"~/.config/tmux/plugins/tpm/tpm\"\n\n> 📌 **Note**\n>  The `/config` directory is persistent on Home Assistant OS, so anything stored here survives reboots.\n\n* * *\n\n## ⚡ Step 2: Create the Init Script\n\nNow create the script to add the additional configuration on startup, `/config/fix_tmux_init.sh`:\n\n\n    #!/bin/bash\n\n    echo \"source /config/tmux_additional.conf\" >> ~/.tmux.conf\n\nThis appends a line telling `tmux` to load your custom config.\n\n* * *\n\n## 🚀 Step 3: Run It on Startup\n\nYou’ll need to ensure this script runs during system startup.\n\n> 🔧 **Options** Add it to an init scriptCall it via a Home Assistant automationCall it using the app page's settings\n\nI used the init_commands in the advanced shells configuration\n\nThe key requirement: **it runs after the user environment is ready**.\n\n* * *\n\n## 🧪 Why This Works\n\n> ✅ `/config` is persistent\n> ✅ `.tmux.conf` is rebuilt/reset\n> ✅ Script re-injects your config every boot\n\nIt’s simple, slightly hacky—but very effective.\n\n* * *\n\n## ⚠️ Gotcha: Duplicate Entries\n\nOne issue: this script appends the same line every time it runs.\n\n> ⚠️ **Problem**\n>  You’ll eventually end up with multiple identical `source` lines in `.tmux.conf`. While this isn't actually an issue for the advanced shell running in a docker container like on the yellow, it is best practice.\n\n### ✅ Improved Version\n\nThis ensures the line is only added once.\n\n\n    #!/bin/bash\n\n    grep -qxF 'source /config/tmux_additional.conf' ~/.tmux.conf || echo 'source /config/tmux_additional.conf' >> ~/.tmux.conf\n\n* * *\n\n## 🧰 Make It Executable\n\nDon’t forget to run:\n\n`chmod +x /config/fix_tmux_init.sh`\n\n* * *\n\n## 💬 Final Thoughts\n\nHome Assistant OS isn’t designed for deep shell customisation—but with a few small workarounds, you can still tailor your environment.\n\n> 🧩 **What this gives you** Persistent `tmux` configClean separation of custom settingsEasy future tweaks\n\nIf you spend a lot of time in the terminal on your Home Assistant Yellow, this makes a noticeable difference.",
  "title": "Making Tmux settings permanent with Home Assistant",
  "updatedAt": "2026-04-29T18:00:07.665Z"
}