Skip to content

Commit 1c0c146

Browse files
authored
fix(Server): Fix launching default server (#464)
2 parents 6750b71 + 9577365 commit 1c0c146

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Diff for: CHANGES

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ $ pip install --user --upgrade --pre libtmux
1414

1515
<!-- Maintainers and contributors: Insert change notes for the next release above -->
1616

17+
### Fixes
18+
19+
- Server: Launching of new session with default socket (#857)
20+
1721
## libtmux 0.18.1 (2022-12-28)
1822

1923
### Fixes

Diff for: src/libtmux/server.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def __init__(
120120
tmux_tmpdir is not None
121121
and self.socket_path is None
122122
and self.socket_name is None
123+
and socket_name != "default"
123124
):
124125
self.socket_path = str(tmux_tmpdir / f"tmux-{os.geteuid()}" / socket_name)
125126

@@ -554,11 +555,14 @@ def __repr__(self) -> str:
554555
if self.socket_name is not None:
555556
return (
556557
f"{self.__class__.__name__}"
557-
f"(socket_name={getattr(self, 'socket_name')})"
558+
f"(socket_name={getattr(self, 'socket_name', 'default')})"
558559
)
559-
return (
560-
f"{self.__class__.__name__}" f"(socket_path={getattr(self, 'socket_path')})"
561-
)
560+
elif self.socket_path is not None:
561+
return (
562+
f"{self.__class__.__name__}"
563+
f"(socket_path={getattr(self, 'socket_path')})"
564+
)
565+
return f"{self.__class__.__name__}" f"(socket_path=/tmp/tmux-1000/default)"
562566

563567
#
564568
# Legacy: Redundant stuff we want to remove

0 commit comments

Comments
 (0)