@@ -165,9 +165,12 @@ def __call__(self, prefix, **kwargs):
165
165
)
166
166
167
167
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
+ ]
171
174
172
175
return completion
173
176
@@ -182,8 +185,10 @@ def __call__(self, prefix, **kwargs):
182
185
)
183
186
184
187
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
+ ]
187
192
188
193
return completion
189
194
@@ -196,8 +201,18 @@ def SessionCompleter(prefix, parsed_args, **kwargs):
196
201
socket_path = parsed_args .socket_path
197
202
)
198
203
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
+ ]
201
216
202
217
203
218
def setup_logger (logger = None , level = 'INFO' ):
0 commit comments