Add prompt to bottom of screen and get line of input from user.
343905
def _inputLine(self, prompt, **kwargs):
        ''
        self.inInput = True
        rstatuslen = self.drawRightStatus(self.scr, self.sheets[0])
        attr = 0
        promptlen = clipdraw(self.scr, self.windowHeight-1, 0, prompt, attr, w=self.windowWidth-rstatuslen-1)
        ret = self.editText(self.windowHeight-1, promptlen, self.windowWidth-promptlen-rstatuslen-2,
                            attr=colors.color_edit_cell,
                            unprintablechar=options.disp_unprintable,
                            truncchar=options.disp_truncator,
                            **kwargs)
        self.inInput = False
        return ret
893463
def _user_input() -> str:
    

    lines = []
    try:
        while True:
            line = input()
            if line != '':
                lines.append(line)
            else:
                break
    except (EOFError, KeyboardInterrupt):
        return '\n'.join(lines)
654089
function Prompt(...args) {
  Base.apply(this, args);
  this.opt = args[0],
  this.previousAnswers = args[2];
  this.selected = 0;
  this.paginator = new Paginator();
  this.firstRender = true;
  if (typeof this.opt.placeholder === 'function') {
    this.getPlaceholder = this.opt.placeholder;
  } else if (typeof this.opt.placeholder === 'string') {
    this.getPlaceholder = () => this.opt.placeholder;
  } else {
    this.getPlaceholder = () => 'INSERT HERE';
  }

  const events = observe(args[1]);
  const keyDowns = events.keypress.filter(function(e) {
    return e.key.name === 'down';
  }).share();
  const keyUps = events.keypress.filter(function(e) {
    return e.key.name === 'up';
  }).share();
  keyDowns.takeUntil(events.line).forEach(this.onDownKey.bind(this));
  keyUps.takeUntil(events.line).forEach(this.onUpKey.bind(this));
  events.line.forEach(this.onSubmit.bind(this));
  return this;
}
1261025
def start_prompt(self):
        """"""
        logger.show("Coconut Interpreter:")
        logger.show("(type 'exit()' or press Ctrl-D to end)")
        self.start_running()
        while self.running:
            try:
                code = self.get_input()
                if code:
                    compiled = self.handle_input(code)
                    if compiled:
                        self.execute(compiled, use_eval=None)
            except KeyboardInterrupt:
                printerr("\nKeyboardInterrupt")
1112621
def input(self, prompt, type='', defaultLast=False, **kwargs):
        ''
        if type:
            histlist = list(self.lastInputs[type].keys())
            ret = self._inputLine(prompt, history=histlist, **kwargs)
            if ret:
                self.lastInputs[type][ret] = ret
            elif defaultLast:
                histlist or fail("no previous input")
                ret = histlist[-1]
        else:
            ret = self._inputLine(prompt, **kwargs)

        return ret
135377
def prompt(msg, default=None):
    ""
    if default is not None:
        msg = '{} ({})'.format(msg, repr(default))
    msg = '{}: '.format(msg)
    try:
        s = input(msg)
    except KeyboardInterrupt:
        exit(1)
    except EOFError:
        s = ''
    if not s:
        s = default
    return s
691979
def set_prompt(self):
        """"""
        # No right prompt
        command_line = b'PS2=;RPS1=;RPROMPT=;'
        command_line += b'PROMPT_COMMAND=;'
        command_line += b'TERM=ansi;'
        command_line += b'unset HISTFILE;'
        prompt1, prompt2 = callbacks.add(b'prompt', self.seen_prompt_cb, True)
        command_line += b'PS1="' + prompt1 + b'""' + prompt2 + b'\n"\n'
        return command_line
26748
def _get_input_buffer(self):
        """"""
        input_buffer = ''
        if self.current_prompt_pos is not None:
            input_buffer = self.get_text(self.current_prompt_pos, 'eol')
            input_buffer = input_buffer.replace(os.linesep, '\n')
        return input_buffer
369379
def enter_to_continue(self, message=None):
        
        if message:
            message = message.rstrip() + ' '
        else:
            message = 'Press [Enter] to continue '
        self.__screen.input(message)
898865
def pseudo_raw_input(self, prompt: str) -> str:
        
        if self.use_rawinput:
            try:
                if sys.stdin.isatty():
                    # Wrap in try since terminal_lock may not be locked when this function is called from unit tests
                    try:
                        # A prompt is about to be drawn. Allow asynchronous changes to the terminal.
                        self.terminal_lock.release()
                    except RuntimeError:
                        pass

                    # Deal with the vagaries of readline and ANSI escape codes
                    safe_prompt = rl_make_safe_prompt(prompt)
                    line = input(safe_prompt)
                else:
                    line = input()
                    if self.echo:
                        sys.stdout.write('{}{}\n'.format(prompt, line))
            except EOFError:
                line = 'eof'
            finally:
                if sys.stdin.isatty():
                    # The prompt is gone. Do not allow asynchronous changes to the terminal.
                    self.terminal_lock.acquire()
        else:
            if self.stdin.isatty():
                # on a tty, print the prompt first, then read the line
                self.poutput(prompt, end='')
                self.stdout.flush()
                line = self.stdin.readline()
                if len(line) == 0:
                    line = 'eof'
            else:
                # we are reading from a pipe, read the line to see if there is
                # anything there, if so, then decide whether to print the
                # prompt or not
                line = self.stdin.readline()
                if len(line):
                    # we read something, output the prompt and the something
                    if self.echo:
                        self.poutput('{}{}'.format(prompt, line))
                else:
                    line = 'eof'

        return line.strip()
1240144
private void requestInputMode() {
        if (needInputMethod()) {
            Window window = dialog.getWindow();

            if (window != null) {
                window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
            }
        }
    }
515253
protected function maybe_prompt() {
		if ( ! $this->is_time() ) {
			return;
		}

		\add_action( 'admin_footer', array( $this, 'script' ) );
		if ( false !== $this->op['notice_callback'] ) {
			call_user_func_array( $this->op['notice_callback'], array( &$this ) );
		} else {
			\add_action( 'admin_notices', array( $this, 'add_notice' ) );
		}
	}
1339966
def new_prompt(self, prompt):
        
        if self.get_cursor_line_column()[1] != 0:
            self.write('\n')
        self.write(prompt, prompt=True)
        # now we update our cursor giving end of prompt
        self.current_prompt_pos = self.get_position('cursor')
        self.ensureCursorVisible()
        self.new_input_line = False
597197
public void prompt() {
        if (promptOnError) {
            System.err.println(localize("resume.abort"));
            try {
                while (true) {
                    switch (System.in.read()) {
                    case 'a': case 'A':
                        System.exit(-1);
                        return;
                    case 'r': case 'R':
                        return;
                    case 'x': case 'X':
                        throw new AssertionError("user abort");
                    default:
                    }
                }
            } catch (IOException e) {}
        }
    }
654231
def interact(title, description, prompt, binary, options):
    """"""
    args = [binary]
    p = subprocess.Popen(args=args,
                         stdin=subprocess.PIPE,
                         stdout=subprocess.PIPE,
                         env=os.environ)
    p.args = args  # TODO: remove after Python 2 deprecation.
    expect(p, [b'OK'])

    title = util.assuan_serialize(title.encode('ascii'))
    write(p, b'SETTITLE ' + title + b'\n')
    expect(p, [b'OK'])

    if description:
        description = util.assuan_serialize(description.encode('ascii'))
        write(p, b'SETDESC ' + description + b'\n')
        expect(p, [b'OK'])

    if prompt:
        prompt = util.assuan_serialize(prompt.encode('ascii'))
        write(p, b'SETPROMPT ' + prompt + b'\n')
        expect(p, [b'OK'])

    log.debug('setting %d options', len(options))
    for opt in options:
        write(p, b'OPTION ' + opt + b'\n')
        expect(p, [b'OK', b'ERR'])

    write(p, b'GETPIN\n')
    pin = expect(p, [b'OK', b'D '], confidential=True)

    p.communicate()  # close stdin and wait for the process to exit
    exit_code = p.wait()
    if exit_code:
        raise subprocess.CalledProcessError(exit_code, binary)

    return pin.decode('ascii').strip()
812906
def get_input(self, more=False):
        """"""
        received = None
        try:
            received = self.prompt.input(more)
        except KeyboardInterrupt:
            print()
            printerr("KeyboardInterrupt")
        except EOFError:
            print()
            self.exit_runner()
        else:
            if received.startswith(exit_chars):
                self.exit_runner()
                received = None
        return received
799364
def custom_prompt(msg, delims="", completer=lambda: None):
    """"""
    try:
        orig_delims = readline.get_completer_delims()
        orig_completer = readline.get_completer()

        readline.set_completer_delims(delims)
        readline.set_completer(completer)

        try:
            ret = input(msg)
        finally:
            readline.set_completer_delims(orig_delims)
            readline.set_completer(orig_completer)

        return ret
    except EOFError:
        raise UserQuit()