Skip to content

Commit

Permalink
720 redux (#723)
Browse files Browse the repository at this point in the history
* Specify socket in 'tmux_has_session?'

This fixes #719. The socket must be specified via 'socket_name' and not
via 'tmux_options'.

* 720-redux - use Project#tmux in Project#tmux_has_session? which conditionally includes socket flag

* 720-redux - update CHANGELOG.md
  • Loading branch information
ethagnawl committed Sep 27, 2019
1 parent 56064c2 commit beb2218
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## UNRELEASED
- prevent commands from being re-run when re-attaching to session using custom
socket (#719)
- add note to README which covers temporary workaround for layout issues (#651)

## 1.1.1
Expand Down Expand Up @@ -36,8 +38,8 @@
## 0.14.0
### Misc
- Add `--suppress-tmux-version-warning` flag to prevent tmux version warning (#583)
- Separate version warning from deprecation messages
- Add unsupported version warnings for `stop` and `local` as well
- Separate version warning from deprecation messages
- Add unsupported version warnings for `stop` and `local` as well
- quiet deprecation warnings in test output (#619)
- reword "Project Configuration Location" section of README to reflect current
behavior (#621)
Expand Down
2 changes: 1 addition & 1 deletion lib/tmuxinator/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def tmux_has_session?(name)
# to server: Connection refused" error message and non-zero exit status
# if no tmux sessions exist.
# Please see issues #402 and #414.
sessions = `#{tmux_command} ls 2> /dev/null`
sessions = `#{tmux} ls 2> /dev/null`

# Remove any escape sequences added by `shellescape` in Project#name.
# Escapes can result in: "ArgumentError: invalid multibyte character"
Expand Down
5 changes: 3 additions & 2 deletions spec/lib/tmuxinator/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
describe "#tmux_has_session?" do
context "no active sessions" do
before do
cmd = "#{project.tmux_command} ls 2> /dev/null"
tmux = project.tmux_command
cmd = "#{tmux} -f ~/.tmux.mac.conf -L foo ls 2> /dev/null"
resp = ""
call_tmux_ls = receive(:`).with(cmd).at_least(:once).and_return(resp)

Expand All @@ -93,7 +94,7 @@

context "active sessions" do
before do
cmd = "#{project.tmux_command} ls 2> /dev/null"
cmd = "#{project.tmux} ls 2> /dev/null"
resp = ""\
"foo: 1 window (created Sun May 25 10:12:00 1986) [0x0] (detached)\n"\
"bar: 1 window (created Sat Sept 01 00:00:00 1990) [0x0] (detached)"
Expand Down

0 comments on commit beb2218

Please sign in to comment.