def env_list(args): names = ev.all_environment_names() color_names = [] for name in names: if ev.active(name): name = colorize('@*g{%s}' % name) color_names.append(name) # say how many there are if writing to a tty if sys.stdout.isatty(): if not names: tty.msg('No environments') else: tty.msg('%d environments' % len(names)) colify(color_names, indent=4)