On Linux, with default pager settings, run ceylon help, then terminate the process with Ctrl+C. This will leave the terminal in a weird state where:
less is terminated, but its output still visible
- your prompt is printed (right after the
less prompt ‘:’)
- the next character will be swallowed (for some meaning of “character” –
Esc and Enter have the same effect, while Ctrl+C will re-print the prompt)
- upon entering that character, the terminal will reset to show the regular output before
less was started
- the terminal is “silent”, characters typed are not echoed – blind-type
reset and hit Enter to fix this
I have no idea what’s going on here; I tried to investigate it, but didn’t arrive at any conclusions. Notes:
-
less is supposed to stay open when its input is closed, and ignore Ctrl+C itself. This is useful, for instance, when running git log -Ssearch (or another expensive Git operation) – you’ll terminate git after the first few results are there, then look through those results with less still up.
- in the above scenario,
git actually continues running after terminated – not sure what’s happening here.
-
piping ceylon help into less manually works without problems.
-
this only happens for less, CEYLON_PAGER=more ceylon help works without problems.
-
it happens no matter how much you hide less:
echo -e "#!/bin/bash\nsleep 1; bash -c 'sleep 1; less'" > pager;
chmod +x ./pager;
CEYLON_PAGER=./pager ceylon help
CC ceylon/ceylon-compiler#1506.
On Linux, with default pager settings, run
ceylon help, then terminate the process withCtrl+C. This will leave the terminal in a weird state where:lessis terminated, but its output still visiblelessprompt ‘:’)EscandEnterhave the same effect, whileCtrl+Cwill re-print the prompt)lesswas startedresetand hitEnterto fix thisI have no idea what’s going on here; I tried to investigate it, but didn’t arrive at any conclusions. Notes:
lessis supposed to stay open when its input is closed, and ignoreCtrl+Citself. This is useful, for instance, when runninggit log -Ssearch(or another expensive Git operation) – you’ll terminategitafter the first few results are there, then look through those results withlessstill up.gitactually continues running after terminated – not sure what’s happening here.piping
ceylon helpintolessmanually works without problems.this only happens for
less,CEYLON_PAGER=more ceylon helpworks without problems.it happens no matter how much you hide
less:CC ceylon/ceylon-compiler#1506.