[Aboriginal] [Toybox] 3efd6d9512ac8c9370d62fcaa08d31c28bba1810 broke ps without a tty

enh enh at google.com
Mon Feb 20 10:23:23 PST 2017


On Sat, Feb 18, 2017 at 5:30 PM, Rob Landley <rob at landley.net> wrote:
> On 02/04/2017 01:03 PM, enh wrote:
>>> In theory the ANSI size probe should go in here somewhere. In practice
>>> we're not already reading data from stdin so parsing the results isn't a
>>> natural part of the program flow.
>>>
>>> (I note that top is also glitched without a tty. I suspect receipt of
>>> the ansi probe causes a redraw... which sends out a new ansi probe.)
>>
>> quitting top if it ran like this is weird too. the escape sequences to
>> reset the terminal don't make it.
>
> They're making it here...?
>
> Define "quit". Is adb exiting before the output is flushed? Both Q and
> ctrl-C are interpreted as key sequences, not signals (because stdin is
> in raw mode), so the cleanup shouldn't get interrupted...?

if you "adb shell" and then run "top" interactively, both q and ctrl-c
work fine.

if you "adb shell top", you need "q\n" to politely quit, and ctrl-c kills adb.

i think this is intended behavior (and you can use -t/-T to control
it, as with ssh(1)), though i'm increasingly uncertain that this was
really a good model to emulate, given that i have no data about how
many people use "interactive" versus "non-interactive" and a strong
suspicion that people run interactive commands like top in what ssh
would (and modern adb does) interpret as non-interactive mode.

>> i've never mentioned it because i
>> don't have any suggestion for how we could do better.
>
> I'd like to fix it but am not reproducing the problem here.

as i was trying to say, i don't think it's your bug. i think it's an
unfortunate interaction (no pun intended) between adb and top's ideas
of interactivity. i think just i'm trying to psych myself up to saying
adb shouldn't match ssh in this...

(ssh+top sidesteps this by ssh not passing through $TERM when
non-interactive and top refusing to start without $TERM.)

>>> Moral of the story: don't let your main test environment fall too far
>>> behind or stupid stuff accumulates. I'm working on it...
>
> Sounds like I'll need a proper android test environment soon.
>
> Rob



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.


More information about the Aboriginal mailing list