Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15862 > unrolled thread
| Started by | Chet Ramey <chet.ramey@case.edu> |
|---|---|
| First post | 2020-02-04 10:07 -0500 |
| Last post | 2020-02-04 10:07 -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.
Re: print/echo lost from COMMAND_PROMPT Function Chet Ramey <chet.ramey@case.edu> - 2020-02-04 10:07 -0500
| From | Chet Ramey <chet.ramey@case.edu> |
|---|---|
| Date | 2020-02-04 10:07 -0500 |
| Subject | Re: print/echo lost from COMMAND_PROMPT Function |
| Message-ID | <mailman.273.1580828878.2412.bug-bash@gnu.org> |
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 -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
Back to top | Article view | gnu.bash.bug
csiph-web