Path: csiph.com!3.us.feeder.erje.net!feeder.erje.net!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Manish Patel Newsgroups: gnu.bash.bug Subject: Re: print/echo lost from COMMAND_PROMPT Function Date: Tue, 4 Feb 2020 16:59:26 -0500 Lines: 45 Approved: bug-bash@gnu.org Message-ID: References: <258ec5bc-56ef-54c9-fc9b-27dd968574c0@case.edu> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: usenet.stanford.edu 1580853572 27893 209.51.188.17 (4 Feb 2020 21:59:32 GMT) X-Complaints-To: action@cs.stanford.edu To: chet.ramey@case.edu, bug-bash@gnu.org, bash@packages.debian.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Qb0tN8uDlisFCqXU25rqYlQf12WjioFACKegXWM+mFU=; b=VRyMXDZ2uU1UHpOC3cb7X3B4tdYi17DbAqkuxZYhiRsXFseCfjo8rfQYC4WDeWcdbm O8/yIrwWf4gugkN95lOZ4ibBPV0eF1oqDEmPUrJJ5BmFbbBbN+sAlr0hrKDhE15YYY83 MjFsvQhLR7mkOPvi7RZS5LBz+ovLz1FeZI5hY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=Qb0tN8uDlisFCqXU25rqYlQf12WjioFACKegXWM+mFU=; b=bCR1phhFOJGXiUXjXlXAgOm4J+D+no7O0NX0dWywYCi1QY4gBDYDp1J4ZNZaugDoYS GBDGqnLgZIT9bG4hlDOdpcV37K7xQ8g+p7DURmpzOLuJxlptWyCvsOK7G0/wvSor6s1q io9xZPH/QX7IUOEwzhexwZO/+kb1vMmn8c0frBQXqgqELsKIs5VhteIQ6nYJB42jl93/ QDJ72LfIpsy52CI9V+60hvS/3cm85p7rlGsf686NBLAZz4SRYwSBeKKzWYdKX0cojjyB DD/WtQcu121KayiW6Zy4HR603JtI+FN1r93bOoEky7gLTMiq35qzP4Xkbqkg7pDlwb/V UDbA== X-Gm-Message-State: APjAAAVB+Xcvjcuj2oARYeGXRWHCvHrtrVfocbx/hJKBaxs5usH/7K9s zcDqh5sWNpqt6OlugW98fC0ggQ== X-Google-Smtp-Source: APXvYqy0p3SLDe4pVaC+RCPFakyp0Vr4koJMr/S5ujzvroyx5dHq/Jgbhn4pCpbpKj+mSBQOdchbVQ== X-Received: by 2002:a5d:674d:: with SMTP id l13mr23297761wrw.11.1580853565726; Tue, 04 Feb 2020 13:59:25 -0800 (PST) Openpgp: preference=signencrypt Autocrypt: addr=manish.patel2@broadcom.com; prefer-encrypt=mutual; keydata= mQENBFcqAo0BCADRIJA0e9R6lRm074qCsJuJMAiEbUIzumWZIHMs4JHVdlXJwQ0EWefGvBIM VsbnMeCUSjjx20Q0wStCP5Uxhu2yIbrbgF1FOdfxj7XUgMC/OEnj2m0cTP26TPCpQ2EMkJ2P 2BUuQ0HY+BfmC7v8dYQ0LNErJcO3WlAheg72TGtPEh3zpEOsY44NQaiM8rc5AF9zyNeVf6xw tSliTOlrWuikn/fy/hK8Zg8OxrD599LlWCeciQM10kQOhj2MgPkzfti88FHsP568ajQfdLO+ BO0oOqJyDL+s5zi27kF1u+1Q8FLYi50H9DZCmtFUdzYRucrQ4oUh/H+6lL9Rtl9L4dgbABEB AAG0KU1hbmlzaCBQYXRlbCA8bWFuaXNoLnBhdGVsMkBicm9hZGNvbS5jb20+iQHHBBABCACx BQJc/m6jFwoAAb9Iy/59LfFRBZrQ2vI+6hEaOwDdIBQAAAAAABYAAWtleS11c2FnZS1tYXNr QHBncC5jb22MMBSAAAAAACAAB3ByZWZlcnJlZC1lbWFp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U+7U8OeEpfSjEQGDUhErchohtrjj8vvzPNiKo39O M1Zr34YVNgDu66lXtSgmwsiuoZPD0aLOmSL8HZo0YwuMEVnfLr4qbMqOjha1j3onpjiuMsHf /RlraO5U59yVi46GDOkzDxlIZoTgdphfrk+g62ndQFmlDfbV5AYuusgjUtH5mkZ//ULwf6+y 9YV0AAoJEGfabLqFQAEUG+cH/jVUrlGcNBSC72NTpWiw5axbtT8XAsSpuUs8RzDEx6BhIX0f 0L+wlHZYDX5iwH0OYZHIh0NFX5y4Bc8T0yuIrQN1aoPdUHpTgxKfMojjmRcw8yijgGANURma 5EaGqLJvelcj6+3EFAQtITHihpwSSgmb/ABihpNV3eAF7UicfFehRAHMiFDyJi6eGMiM4TZ3 PzTnn5IYNfdRotL5KxnDU7zPhwD4SVj4/nFF2jdQTIXpT5dsOmW8fHxFryl2JPid1oxnrzAu 3lUM3ItmiuCetUgthQGyvwx/jfHMJg+G6LBIVyTdbBnN9+mjF1Bf6YcPaY+OnF4VFxmDB3D3 vZsN/w8= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 In-Reply-To: <258ec5bc-56ef-54c9-fc9b-27dd968574c0@case.edu> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <258ec5bc-56ef-54c9-fc9b-27dd968574c0@case.edu> Xref: csiph.com gnu.bash.bug:15864 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 >