[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.

--------------------------------

1.
(devel@REDACTED)3> |

    {trace,<0.28.0>,'receive',{#Port<0.349>,{data,[18]}}}
    {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)`': "}]}}}
    {trace,<0.28.0>,'receive',{<0.30.0>,beep}}

2.
(search)`': |

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

3.
(search)`
|': 

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

4.
(search)`
|': 

    {trace,<0.28.0>,'receive', {<0.30.0>,
                                {requests,[{put_chars,unicode,"(devel@REDACTED)3> "},
                                {put_chars,unicode,[]},
                                {move_rel,0}]}}}
5.
(search)`
(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.

Leo




More information about the erlang-questions mailing list