Re: print/echo lost from COMMAND_PROMPT Function
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, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/
Important request, participation in software development study
Dear Engineers, When I write this message, I think I am writing to the best software developers in the world, or to those who are in the process of being one. I write to ask you a favor. I am a UMA PhD student and I study the use of formal and non-formal models in the software industry. According to 9 investigations, UML is not being used as it should, but the developers use their own models, designed by them or by their companies. However, these investigations have not included professionals like you, so I want to ask you to help me by answering this survey: https://docs.google.com/forms/d/e/1FAIpQLSdG4bhNWfU3vzSKwG-0j8NuGW47_xmSY1ftF33gaNAZsU25kA/viewform I also ask you to send this survey to other developers that you know and respect. Please help me, I promise that your contributions will be recognized in the publications that are possible, therefore, as an optional field I have included the name and email. My biggest goal is to unify all non-formal models to create a modeling language that is the heritage of the industry, built by all of us. If you want to know more, you can write to me at ivan.arr...@uma.es, ivandarioarr...@gmail.com or arco...@gmail.com ¡¡THANKS!!
Re: print/echo lost from COMMAND_PROMPT Function
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 >
Re: Important request, participation in software development study
On Tue, 4 Feb 2020 11:45:45 -0500 (COT), ivandarioarr...@gmail.com wrote: > Dear Engineers, > > When I write this message, I think I am writing to the best software > developers in the world, or to those who are in the process of being > one. It will be interesting to see what other ng's this pops up in -- the other ones "with the best software developers in the world..."