Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15864 > unrolled thread

Re: print/echo lost from COMMAND_PROMPT Function

Started byManish Patel <manish.patel2@broadcom.com>
First post2020-02-04 16:59 -0500
Last post2020-02-04 16:59 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: print/echo lost from COMMAND_PROMPT Function Manish Patel <manish.patel2@broadcom.com> - 2020-02-04 16:59 -0500

#15864 — Re: print/echo lost from COMMAND_PROMPT Function

FromManish Patel <manish.patel2@broadcom.com>
Date2020-02-04 16:59 -0500
SubjectRe: print/echo lost from COMMAND_PROMPT Function
Message-ID<mailman.300.1580853571.2412.bug-bash@gnu.org>
Thank you Chet,

  In that case, how do I compile my own bash with specific version of
readline?
I can not install readline to system but I can compile both in my home
directory.

Thanks
Manish.

On 2/4/20 10:07 AM, Chet Ramey wrote:
> On 2/3/20 3:26 PM, Manish Patel wrote:
>
>> Bash Version: 4.4
>> Patch Level: 20
>> Release Status: release
>>
>> Description:
>>         Print/echo is lost when generated from a function in
>> COMMAND_PROMPT and placed in background in subshell.
>>
>> I have embedded some git information in my command prompt.
>> However, due to large git data, it takes some time to calculate it all.
>> So I have placed
>> the git processing in the background function, which I call from
>> COMMAND_PROMPT.
> Readline assumes two things: it starts with the cursor in column 0, and
> it is the only thing writing to the screen during redisplay, so it always
> knows where the cursor is and can make redisplay decisions accordingly.
> Your writing to the screen from a background process violates one or both
> of these, so all bets are off. It may be the case that readline decides to
> redisplay by moving to column 0, redrawing the prompt, moving the cursor,
> and redrawing the changed portions of the line,in which case whatever your
> process writes at the beginning of the line gets overwritten. It may be the
> case that writing to the screen moves the cursor forward so readline
> doesn't move the cursor to the right place or wrap correctly.
>
> There are no guarantees that anything a background process writes to the
> screen will be preserved, or that writing to the screen and moving the
> physical cursor will not interfere with readline's redisplay.
>
> Chet
>

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web