-
-
Notifications
You must be signed in to change notification settings - Fork 237
feat: add tmux to base image and auto-launch it #2115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+114
−3
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4cba5cc
feat: add tmux to base image and auto-launch it
hunleyd 6773f58
Update ansible/tasks/setup-tmux.yml
hunleyd 434b43a
fix: fixups from copilot
hunleyd 7ac23b9
Merge branch 'INDATA-574' of github.com:supabase/postgres into INDATA…
hunleyd 5188069
fix: formatting
hunleyd b36d1d8
chore: bump ami version string
hunleyd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Keep the default prefix | ||
| set-option -g prefix C-b | ||
|
|
||
| # Add Ctrl-a as a second prefix | ||
| set-option -g prefix2 C-a | ||
|
|
||
| # Ensure that pressing Ctrl-a twice sends the prefix to the inner application | ||
| # (Useful for nested tmux sessions or programs that use Ctrl-a) | ||
| bind-key C-a send-prefix -2 | ||
|
|
||
| # split panes using | and - | ||
| bind | split-window -h | ||
| bind - split-window -v | ||
|
|
||
| # switch panes using Alt-arrow without prefix | ||
| bind -n M-Left select-pane -L | ||
| bind -n M-Right select-pane -R | ||
| bind -n M-Up select-pane -U | ||
| bind -n M-Down select-pane -D | ||
|
|
||
| # Enable mouse control (clickable windows, panes, resizable panes) | ||
| set -g mouse on | ||
|
|
||
| # DESIGN TWEAKS | ||
|
|
||
| # don't do anything when a 'bell' rings | ||
| set -g visual-activity off | ||
| set -g visual-bell off | ||
| set -g visual-silence off | ||
| setw -g monitor-activity off | ||
| set -g bell-action none | ||
|
|
||
| # clock mode | ||
| setw -g clock-mode-colour yellow | ||
|
|
||
| # copy mode | ||
| setw -g mode-style 'fg=black bg=red bold' | ||
|
|
||
| # panes | ||
| set -g pane-border-style 'fg=red' | ||
| set -g pane-active-border-style 'fg=yellow' | ||
|
|
||
| # statusbar | ||
| set -g status-position bottom | ||
| set -g status-justify left | ||
| set -g status-style 'fg=red' | ||
|
|
||
| set -g status-left '' | ||
| set -g status-left-length 10 | ||
|
|
||
| set -g status-right-style 'fg=black bg=yellow' | ||
| set -g status-right '%Y-%m-%d %H:%M ' | ||
| set -g status-right-length 50 | ||
|
|
||
| setw -g window-status-current-style 'fg=black bg=red' | ||
| setw -g window-status-current-format ' #I #W #F ' | ||
|
|
||
| setw -g window-status-style 'fg=red bg=black' | ||
| setw -g window-status-format ' #I #[fg=white]#W #[fg=yellow]#F ' | ||
|
|
||
| setw -g window-status-bell-style 'fg=yellow bg=red bold' | ||
|
|
||
| # messages | ||
| set -g message-style 'fg=yellow bg=red bold' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| - name: tmux - Install tmux | ||
| ansible.builtin.apt: | ||
| name: 'tmux' | ||
| state: 'present' | ||
| update_cache: true | ||
| become: true | ||
|
|
||
| - name: tmux - Configure shell auto-logout | ||
| ansible.builtin.copy: | ||
| content: | | ||
| case "$-" in | ||
| *i*) export TMOUT=600 ;; | ||
| esac | ||
| dest: '/etc/profile.d/11-shell_timeout.sh' | ||
| group: 'root' | ||
| mode: '0644' | ||
| owner: 'root' | ||
| become: true | ||
|
hunleyd marked this conversation as resolved.
|
||
|
|
||
| - name: tmux - Configure tmux | ||
| ansible.builtin.template: | ||
| dest: '/etc/tmux.conf' | ||
| group: 'root' | ||
| mode: '0644' | ||
| owner: 'root' | ||
| src: 'files/tmux.conf.j2' | ||
| become: true | ||
|
|
||
| - name: tmux - Auto-launch tmux as needed | ||
| ansible.builtin.copy: | ||
| content: | | ||
| case "$-" in | ||
| *i*) | ||
| case "$TERM" in | ||
| tmux*) ;; | ||
| *) tmux new-session -A -s supa ;; | ||
| esac | ||
| ;; | ||
| esac | ||
| dest: '/etc/profile.d/12-tmux.sh' | ||
| group: 'root' | ||
| mode: '0644' | ||
| owner: 'root' | ||
| become: true | ||
|
hunleyd marked this conversation as resolved.
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.