When readline is enabled, php switches the terminal mode to accept line-buffered input. This means that the proper way to use the cli when you pipe to an interactive command is to explicitly specify that php is not using the terminal for input:
php somescript.php < /dev/null | less| CARVIEW |
Select Language
HTTP/2 301
server: myracloud
date: Fri, 26 Dec 2025 13:24:47 GMT
content-type: text/html
content-length: 161
location: https://www.php.net/readline
HTTP/2 200
server: myracloud
date: Fri, 26 Dec 2025 13:24:48 GMT
content-type: text/html; charset=utf-8
content-language: en
permissions-policy: interest-cohort=()
x-frame-options: SAMEORIGIN
status: 200 OK
link: ; rel=shorturl
last-modified: Fri, 26 Dec 2025 12:08:06 GMT
vary: accept-encoding
content-encoding: gzip
expires: Fri, 26 Dec 2025 13:24:48 GMT
cache-control: max-age=0
PHP: Readline - Manual
update page now
GNU Readline
- Introduction
- Installing/Configuring
- Predefined Constants
- Readline Functions
- readline — Reads a line
- readline_add_history — Adds a line to the history
- readline_callback_handler_install — Initializes the readline callback interface and terminal, prints the prompt and returns immediately
- readline_callback_handler_remove — Removes a previously installed callback handler and restores terminal settings
- readline_callback_read_char — Reads a character and informs the readline callback interface when a line is received
- readline_clear_history — Clears the history
- readline_completion_function — Registers a completion function
- readline_info — Gets/sets various internal readline variables
- readline_list_history — Lists the history
- readline_on_new_line — Inform readline that the cursor has moved to a new line
- readline_read_history — Reads the history
- readline_redisplay — Redraws the display
- readline_write_history — Writes the history
+add a note
User Contributed Notes 1 note
list2011 at lunch dot za dot net ¶
13 years ago
↑ and ↓ to navigate •
Enter to select •
Esc to close • / to open
Press Enter without
selection to search using Google