tmuxinator 3.2.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b548f97e14ad874cb4ef91cb7e8380419943e9027786936679d9ab545ab94d47
4
- data.tar.gz: 5fc432b4f26221a1f2f08bb7478383dc2f279a84221e0befc2ed41f9fb9de55b
3
+ metadata.gz: 837a353050a6ac064ea463e3e33113a845a1b555a9069c2514045b59440a634b
4
+ data.tar.gz: '008ef11a9c0734010632d58c06ea63f9ebc1d46eba0cfb4153c1dc63b1c7b6bc'
5
5
  SHA512:
6
- metadata.gz: b4ca459d020b59ffd5ecd5862b93b8e182526b0b819411989da94b5801d5759ba79cea1145d1a748c597060321072a7e38bd525de77749b62dde9b51fdcf02f4
7
- data.tar.gz: 388caf62bd2441710ca97ef1be6be692f72cd52b86c3076ffedfc4ed48b90b6137d33e887ac2742f0288a47bafef12518118413800a022a7c17bd7f7620e9115
6
+ metadata.gz: 81c8a46ec5380f78d7db741ee707d69e25ac5d6edb56892e861ebfe06131d1c7d2725f6ce4e8880192564e761ff4e2a4de50087b01addfa0d3a6305df444c4f1
7
+ data.tar.gz: 39c755d7aa5c61ff52b225ab1a2a3f5f7eef68c58cfefcd421c217f350e304b2b3f920df61af349d004e7cc53eff61d69e84afd9179fd113a4ca86dda185f039
@@ -21,9 +21,15 @@ cd <%= root || "." %>
21
21
 
22
22
  # Create the session and the first window. Manually switch to root
23
23
  # directory if required to support tmux < 1.9
24
- TMUX= <%= tmux_new_session_command %>
25
24
  <% if windows.first.root? %>
25
+ <% if Tmuxinator::Config.version < 1.9 %>
26
+ TMUX= <%= tmux_new_session_command %>
26
27
  <%= windows.first.tmux_window_command_prefix %> <%= "cd #{windows.first.root}".shellescape %> C-m
28
+ <%- else -%>
29
+ TMUX= <%= tmux_new_session_command %> -c <%= windows.first.root.shellescape %>
30
+ <% end %>
31
+ <%- else -%>
32
+ TMUX= <%= tmux_new_session_command %>
27
33
  <% end %>
28
34
 
29
35
  <% if Tmuxinator::Config.version < 1.7 %>
@@ -36,12 +42,9 @@ cd <%= root || "." %>
36
42
  <% if enable_pane_titles? %>
37
43
  <% if Tmuxinator::Config.version < 2.6 %>
38
44
  <%= pane_titles_not_supported_warning %>
39
- <%- else -%>
40
- <% if pane_title_position? && !pane_title_position_valid? %>
45
+ <% end %>
46
+ <% if pane_title_position? && !pane_title_position_valid? %>
41
47
  <%= pane_title_position_not_valid_warning %>
42
- <% end %>
43
- <%= tmux_set_pane_title_position %>
44
- <%= tmux_set_pane_title_format %>
45
48
  <% end %>
46
49
  <% end %>
47
50
 
@@ -56,6 +59,12 @@ cd <%= root || "." %>
56
59
  <% if window.synchronize_before? %>
57
60
  <%= window.tmux_synchronize_panes %>
58
61
  <% end %>
62
+
63
+ <% if enable_pane_titles? && Tmuxinator::Config.version >= 2.6 %>
64
+ <%= tmux_set_pane_title_position(window.tmux_window_target) %>
65
+ <%= tmux_set_pane_title_format(window.tmux_window_target) %>
66
+ <% end %>
67
+
59
68
  <% unless window.panes? %>
60
69
  <% if window.project.pre_window %>
61
70
  <%= window.tmux_pre_window_command %>
@@ -341,19 +341,21 @@ module Tmuxinator
341
341
  yaml["enable_pane_titles"]
342
342
  end
343
343
 
344
- def tmux_set_pane_title_position
344
+ def tmux_set_pane_title_position(tmux_window_target)
345
+ command = set_window_option(tmux_window_target)
345
346
  if pane_title_position? && pane_title_position_valid?
346
- "#{tmux} set pane-border-status #{yaml['pane_title_position']}"
347
+ "#{command} pane-border-status #{yaml['pane_title_position']}"
347
348
  else
348
- "#{tmux} set pane-border-status top"
349
+ "#{command} pane-border-status top"
349
350
  end
350
351
  end
351
352
 
352
- def tmux_set_pane_title_format
353
+ def tmux_set_pane_title_format(tmux_window_target)
354
+ command = set_window_option(tmux_window_target)
353
355
  if pane_title_format?
354
- "#{tmux} set pane-border-format \"#{yaml['pane_title_format']}\""
356
+ "#{command} pane-border-format \"#{yaml['pane_title_format']}\""
355
357
  else
356
- "#{tmux} set pane-border-format \"\#{pane_index}: \#{pane_title}\""
358
+ "#{command} pane-border-format \"\#{pane_index}: \#{pane_title}\""
357
359
  end
358
360
  end
359
361
 
@@ -438,5 +440,9 @@ module Tmuxinator
438
440
  msg = "WARNING: #{message}\n"
439
441
  "printf \"#{yellow}#{msg}#{no_color}\""
440
442
  end
443
+
444
+ def set_window_option(tmux_window_target)
445
+ "#{tmux} set-window-option -t #{tmux_window_target}"
446
+ end
441
447
  end
442
448
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tmuxinator
4
- VERSION = "3.2.0"
4
+ VERSION = "3.2.1"
5
5
  end
@@ -663,8 +663,8 @@ describe Tmuxinator::Project do
663
663
  before { project.yaml["pane_title_position"] = nil }
664
664
 
665
665
  it "configures a default position of top" do
666
- expect(project.tmux_set_pane_title_position).to eq(
667
- "tmux set pane-border-status top"
666
+ expect(project.tmux_set_pane_title_position("x")).to eq(
667
+ "tmux set-window-option -t x pane-border-status top"
668
668
  )
669
669
  end
670
670
  end
@@ -673,8 +673,8 @@ describe Tmuxinator::Project do
673
673
  before { project.yaml["pane_title_position"] = "bottom" }
674
674
 
675
675
  it "configures a position of bottom" do
676
- expect(project.tmux_set_pane_title_position).to eq(
677
- "tmux set pane-border-status bottom"
676
+ expect(project.tmux_set_pane_title_position("x")).to eq(
677
+ "tmux set-window-option -t x pane-border-status bottom"
678
678
  )
679
679
  end
680
680
  end
@@ -683,8 +683,8 @@ describe Tmuxinator::Project do
683
683
  before { project.yaml["pane_title_position"] = "other" }
684
684
 
685
685
  it "configures the default position" do
686
- expect(project.tmux_set_pane_title_position).to eq(
687
- "tmux set pane-border-status top"
686
+ expect(project.tmux_set_pane_title_position("x")).to eq(
687
+ "tmux set-window-option -t x pane-border-status top"
688
688
  )
689
689
  end
690
690
  end
@@ -693,9 +693,10 @@ describe Tmuxinator::Project do
693
693
  before { project.yaml["pane_title_format"] = nil }
694
694
 
695
695
  it "configures a default format" do
696
- expect(project.tmux_set_pane_title_format).to eq(
697
- "tmux set pane-border-format \"\#{pane_index}: \#{pane_title}\""
698
- )
696
+ resp = ""\
697
+ "tmux set-window-option -t x pane-border-format"\
698
+ " \"\#{pane_index}: \#{pane_title}\""
699
+ expect(project.tmux_set_pane_title_format("x")).to eq(resp)
699
700
  end
700
701
  end
701
702
 
@@ -703,8 +704,8 @@ describe Tmuxinator::Project do
703
704
  before { project.yaml["pane_title_format"] = " [ #T ] " }
704
705
 
705
706
  it "configures the provided format" do
706
- expect(project.tmux_set_pane_title_format).to eq(
707
- 'tmux set pane-border-format " [ #T ] "'
707
+ expect(project.tmux_set_pane_title_format("x")).to eq(
708
+ 'tmux set-window-option -t x pane-border-format " [ #T ] "'
708
709
  )
709
710
  end
710
711
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmuxinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Bargi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-04-18 00:00:00.000000000 Z
12
+ date: 2024-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: erubi
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  - !ruby/object:Gem::Version
303
303
  version: 1.8.23
304
304
  requirements: []
305
- rubygems_version: 3.3.26
305
+ rubygems_version: 3.2.15
306
306
  signing_key:
307
307
  specification_version: 4
308
308
  summary: Create and manage complex tmux sessions easily.