Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tmuxinator/tmuxinator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.2.0
Choose a base ref
...
head repository: tmuxinator/tmuxinator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.2.1
Choose a head ref
  • 3 commits
  • 5 files changed
  • 2 contributors

Commits on Apr 27, 2024

  1. Fix pane title options (#913)

    * fix pane title options
    
    * update changelog
    augustelalande authored Apr 27, 2024
    Copy the full SHA
    8e93026 View commit details

Commits on May 2, 2024

  1. Copy the full SHA
    d7d1d29 View commit details

Commits on May 23, 2024

  1. chore: Bump tmuxinator to 3.2.1

    Signed-off-by: Andrew Kofink <ajkofink@gmail.com>
    akofink committed May 23, 2024
    Copy the full SHA
    0f7e9ff View commit details
Showing with 46 additions and 24 deletions.
  1. +6 −0 CHANGELOG.md
  2. +15 −6 lib/tmuxinator/assets/template.erb
  3. +12 −6 lib/tmuxinator/project.rb
  4. +1 −1 lib/tmuxinator/version.rb
  5. +12 −11 spec/lib/tmuxinator/project_spec.rb
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Unreleased

## 3.2.1
### Enhancements
- Use `tmux -c` if available to reduce spam
### Fixes
- Fix pane title configuration options only applying to first window

## 3.2.0
### Third-party Dependencies
- Replace erubis with erubi
21 changes: 15 additions & 6 deletions lib/tmuxinator/assets/template.erb
Original file line number Diff line number Diff line change
@@ -21,9 +21,15 @@ cd <%= root || "." %>

# Create the session and the first window. Manually switch to root
# directory if required to support tmux < 1.9
TMUX= <%= tmux_new_session_command %>
<% if windows.first.root? %>
<% if Tmuxinator::Config.version < 1.9 %>
TMUX= <%= tmux_new_session_command %>
<%= windows.first.tmux_window_command_prefix %> <%= "cd #{windows.first.root}".shellescape %> C-m
<%- else -%>
TMUX= <%= tmux_new_session_command %> -c <%= windows.first.root.shellescape %>
<% end %>
<%- else -%>
TMUX= <%= tmux_new_session_command %>
<% end %>

<% if Tmuxinator::Config.version < 1.7 %>
@@ -36,12 +42,9 @@ cd <%= root || "." %>
<% if enable_pane_titles? %>
<% if Tmuxinator::Config.version < 2.6 %>
<%= pane_titles_not_supported_warning %>
<%- else -%>
<% if pane_title_position? && !pane_title_position_valid? %>
<% end %>
<% if pane_title_position? && !pane_title_position_valid? %>
<%= pane_title_position_not_valid_warning %>
<% end %>
<%= tmux_set_pane_title_position %>
<%= tmux_set_pane_title_format %>
<% end %>
<% end %>

@@ -56,6 +59,12 @@ cd <%= root || "." %>
<% if window.synchronize_before? %>
<%= window.tmux_synchronize_panes %>
<% end %>

<% if enable_pane_titles? && Tmuxinator::Config.version >= 2.6 %>
<%= tmux_set_pane_title_position(window.tmux_window_target) %>
<%= tmux_set_pane_title_format(window.tmux_window_target) %>
<% end %>

<% unless window.panes? %>
<% if window.project.pre_window %>
<%= window.tmux_pre_window_command %>
18 changes: 12 additions & 6 deletions lib/tmuxinator/project.rb
Original file line number Diff line number Diff line change
@@ -341,19 +341,21 @@ def enable_pane_titles?
yaml["enable_pane_titles"]
end

def tmux_set_pane_title_position
def tmux_set_pane_title_position(tmux_window_target)
command = set_window_option(tmux_window_target)
if pane_title_position? && pane_title_position_valid?
"#{tmux} set pane-border-status #{yaml['pane_title_position']}"
"#{command} pane-border-status #{yaml['pane_title_position']}"
else
"#{tmux} set pane-border-status top"
"#{command} pane-border-status top"
end
end

def tmux_set_pane_title_format
def tmux_set_pane_title_format(tmux_window_target)
command = set_window_option(tmux_window_target)
if pane_title_format?
"#{tmux} set pane-border-format \"#{yaml['pane_title_format']}\""
"#{command} pane-border-format \"#{yaml['pane_title_format']}\""
else
"#{tmux} set pane-border-format \"\#{pane_index}: \#{pane_title}\""
"#{command} pane-border-format \"\#{pane_index}: \#{pane_title}\""
end
end

@@ -438,5 +440,9 @@ def print_warning(message)
msg = "WARNING: #{message}\n"
"printf \"#{yellow}#{msg}#{no_color}\""
end

def set_window_option(tmux_window_target)
"#{tmux} set-window-option -t #{tmux_window_target}"
end
end
end
2 changes: 1 addition & 1 deletion lib/tmuxinator/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Tmuxinator
VERSION = "3.2.0"
VERSION = "3.2.1"
end
23 changes: 12 additions & 11 deletions spec/lib/tmuxinator/project_spec.rb
Original file line number Diff line number Diff line change
@@ -663,8 +663,8 @@
before { project.yaml["pane_title_position"] = nil }

it "configures a default position of top" do
expect(project.tmux_set_pane_title_position).to eq(
"tmux set pane-border-status top"
expect(project.tmux_set_pane_title_position("x")).to eq(
"tmux set-window-option -t x pane-border-status top"
)
end
end
@@ -673,8 +673,8 @@
before { project.yaml["pane_title_position"] = "bottom" }

it "configures a position of bottom" do
expect(project.tmux_set_pane_title_position).to eq(
"tmux set pane-border-status bottom"
expect(project.tmux_set_pane_title_position("x")).to eq(
"tmux set-window-option -t x pane-border-status bottom"
)
end
end
@@ -683,8 +683,8 @@
before { project.yaml["pane_title_position"] = "other" }

it "configures the default position" do
expect(project.tmux_set_pane_title_position).to eq(
"tmux set pane-border-status top"
expect(project.tmux_set_pane_title_position("x")).to eq(
"tmux set-window-option -t x pane-border-status top"
)
end
end
@@ -693,18 +693,19 @@
before { project.yaml["pane_title_format"] = nil }

it "configures a default format" do
expect(project.tmux_set_pane_title_format).to eq(
"tmux set pane-border-format \"\#{pane_index}: \#{pane_title}\""
)
resp = ""\
"tmux set-window-option -t x pane-border-format"\
" \"\#{pane_index}: \#{pane_title}\""
expect(project.tmux_set_pane_title_format("x")).to eq(resp)
end
end

context "pane_title_format configured" do
before { project.yaml["pane_title_format"] = " [ #T ] " }

it "configures the provided format" do
expect(project.tmux_set_pane_title_format).to eq(
'tmux set pane-border-format " [ #T ] "'
expect(project.tmux_set_pane_title_format("x")).to eq(
'tmux set-window-option -t x pane-border-format " [ #T ] "'
)
end
end