code: def selected_shells(command):
      
      if not command or command == '*':
          for i in dispatchers.all_instances():
              yield i
          return
      selected = set()
      instance_found = False
      for pattern in command.split():
          found = False
          for expanded_pattern in expand_syntax(pattern):
              for i in dispatchers.all_instances():
                  instance_found = True
                  if fnmatch(i.display_name, expanded_pattern):
                      found = True
                      if i not in selected:
                          selected.add(i)
                          yield i
          if instance_found and not found:
              console_output('{} not found\n'.format(pattern).encode())
docs: Iterator over the shells with names matching the patterns.
      An empty patterns matches all the shells