code: def command_prompt(pymux, variables):
      
      client_state = pymux.get_client_state()
  
      if variables['<command>']:
          # When a 'command' has been given.
          client_state.prompt_text = variables['<message>'] or '(%s)' % variables['<command>'].split()[0]
          client_state.prompt_command = variables['<command>']
  
          client_state.prompt_mode = True
          client_state.prompt_buffer.reset(Document(
              format_pymux_string(pymux, variables['<default>'] or '')))
  
          get_app().layout.focus(client_state.prompt_buffer)
      else:
          # Show the ':' prompt.
          client_state.prompt_text = ''
          client_state.prompt_command = ''
  
          get_app().layout.focus(client_state.command_buffer)
  
      # Go to insert mode.
      get_app().vi_state.input_mode = InputMode.INSERT
docs: Enter command prompt.