4
1
When I try something like
php -i | less
Less is not responding to hotkeys, but prints them like pressing "q" results in statusline
:q
PageDown
:^[[6~
Pressing ENTER like "executes" the keycode and less perfoems the action.
Piping trivial small stuff work however...
OS: Fedora 14
Actually, it's
less
that does the "something weird". It changes to non-canonical mode input processing. Of coursephp
may well be doing something as well, but this is simply a specific case of the more general don't have two programs simultaneously interacting with the terminal that employ different terminal input modes and expect things to work. – JdeBP – 2011-03-17T20:29:35.563@JdeBP:
less
may very well be doing something weird, but this is fromstrace php -i
withoutless
:ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
– Paused until further notice. – 2011-03-17T21:00:00.050Setting canonical mode input processing (
icanon
) is not "something weird". Canonical mode is the norm. Hence its name. – JdeBP – 2011-03-18T13:44:04.3801@JdeBP: Well, I don't know what's hidden behind the
...
and perhaps the clue lies elsewhere. But why isphp -i
opening stdin at all? It does this same odd behavior withmore
(which is not a symlink or alias on my system), but, interestingly, notpg
or (inconsistently)most
. PHP also does this withphp -r 'for ($i = 1; $i <= 100; $i++) { print "$i\n"; }' | less
. AWK, Perl, Python, etc., don't exhibit this weirdness. Conclusion: PHP is broken. – Paused until further notice. – 2011-03-18T14:42:21.620