Skip to content

Commit e6e5a4e

Browse files
committed
check for oh-my-zsh and DISABLE_AUTO_TITLE
1 parent d4ff617 commit e6e5a4e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tmuxp/cli.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ def main():
302302
logger.error(e)
303303
sys.exit()
304304

305+
oh_my_zsh_auto_title()
306+
305307
if args.callback is subcommand_load:
306308
subcommand_load(args)
307309
elif args.callback is subcommand_attach_session:
@@ -377,6 +379,23 @@ def config_complete(command, commands, ctext):
377379
print(' \n'.join(commands))
378380

379381

382+
def oh_my_zsh_auto_title():
383+
'''give warning and offer to fix DISABLE_AUTO_TITLE
384+
385+
see: https://github.com/robbyrussell/oh-my-zsh/pull/257
386+
'''
387+
388+
if 'SHELL' in os.environ and 'zsh' in os.environ.get('SHELL'):
389+
if os.path.exists(os.path.expanduser('~/.oh-my-zsh')):
390+
# oh-my-zsh exists
391+
if 'DISABLE_AUTO_TITLE' not in os.environ or os.environ.get('DISABLE_AUTO_TITLE') is "true":
392+
print('Please set:\n\n'
393+
'\texport DISABLE_AUTO_TITLE = \'true\'\n\n'
394+
'in ~/.zshrc or where your zsh profile is stored.\n'
395+
'Remember the "export" at the beginning!\n\n'
396+
'Then create a new shell or type:\n\n'
397+
'\t$ source ~/.zshrc')
398+
380399
# check for oh-my-zsh
381400
# you are using oh-my-zsh without DISABLE_AUTO_TITLE, this can cause unexpected
382401
# behavior with tmux window renaming. Let me uncomment for you?

0 commit comments

Comments
 (0)