@@ -165,9 +165,12 @@ def __call__(self, prefix, **kwargs):
165165 )
166166
167167 tmuxinator_configs = config .in_dir (
168- tmuxinator_config_dir , extensions = 'yml' )
169- completion += [os .path .join (tmuxinator_config_dir , f )
170- for f in tmuxinator_configs ]
168+ tmuxinator_config_dir , extensions = 'yml'
169+ )
170+ completion += [
171+ os .path .join (tmuxinator_config_dir , f )
172+ for f in tmuxinator_configs
173+ ]
171174
172175 return completion
173176
@@ -182,8 +185,10 @@ def __call__(self, prefix, **kwargs):
182185 )
183186
184187 teamocil_configs = config .in_dir (teamocil_config_dir , extensions = 'yml' )
185- completion += [os .path .join (teamocil_config_dir , f )
186- for f in teamocil_configs ]
188+ completion += [
189+ os .path .join (teamocil_config_dir , f )
190+ for f in teamocil_configs
191+ ]
187192
188193 return completion
189194
@@ -196,8 +201,18 @@ def SessionCompleter(prefix, parsed_args, **kwargs):
196201 socket_path = parsed_args .socket_path
197202 )
198203
199- return [s .get ('session_name' ) for s in t ._sessions
200- if s .get ('session_name' ).startswith (prefix )]
204+ sessions_available = [
205+ s .get ('session_name' ) for s in t ._sessions
206+ if s .get ('session_name' ).startswith (' ' .join (prefix ))
207+ ]
208+
209+ if parsed_args .session_name and sessions_available :
210+ return []
211+
212+ return [
213+ s .get ('session_name' ) for s in t ._sessions
214+ if s .get ('session_name' ).startswith (prefix )
215+ ]
201216
202217
203218def setup_logger (logger = None , level = 'INFO' ):
0 commit comments