Skip to content

Commit 1182d61

Browse files
committed
shell_plus: Show helper message when no session exists
1 parent 65444af commit 1182d61

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tmuxp/cli.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,17 @@ def command_shell_plus(
779779
"""
780780
server = Server(socket_name=socket_name, socket_path=socket_path)
781781

782+
try:
783+
server.sessions
784+
except LibTmuxException as e:
785+
if 'No such file or directory' in str(e):
786+
raise LibTmuxException(
787+
'no tmux session found. Start a tmux session and try again. \n'
788+
'Original error: ' + str(e)
789+
)
790+
else:
791+
raise e
792+
782793
current_pane = None
783794
if os.getenv('TMUX_PANE') is not None:
784795
try:

0 commit comments

Comments
 (0)