[erlang-questions] how search and search_quit are handled by user_drv?

Leo Liu sdl.web@REDACTED
Wed May 20 18:34:52 CEST 2015

Hi there,

Press key C-r and then TAB in the eshell one can observe the prompt
changes to history `search' and back to normal again.

I try to understand how it works in details but my understanding does
not match what I observe above.

The following is what I think should have happened where `|' indicates
the cursor and indented lines are messages the user_drv process receives
which cause the prompt to change from state 1 to 5.


(devel@REDACTED)3> |

    {trace,<0.28.0>,'receive', {<0.30.0>,{requests,[{delete_chars,0},{delete_chars,-20}]}}}
    {trace,<0.28.0>,'receive', {<0.30.0>,{requests,[{put_chars,unicode,"(search)`': "}]}}}

(search)`': |

    {trace,<0.28.0>,'receive', {<0.30.0>,{requests,[{move_rel,-3},{put_chars,unicode,"\n"}]}}}


    {trace,<0.28.0>,'receive', {<0.30.0>,{requests,[{delete_chars,0},{delete_chars,-12}]}}}


    {trace,<0.28.0>,'receive', {<0.30.0>,
                                {requests,[{put_chars,unicode,"(devel@REDACTED)3> "},
(devel@REDACTED)3> |


State 1 and 2 are as observed. State 3 is NOT though it seems to agree
with {requests,[{move_rel,-3},{put_chars,unicode,"\n"}]}.

Could someone explain the discrepancy? Many thanks.


More information about the erlang-questions mailing list