Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Ricky Tigg Newsgroups: gnu.bash.bug Subject: =?UTF-8?Q?Re=3A_GNUbash_v=2E_4=2E4=2E23=2D5_=E2=80=93_Bash_identifier_location?= =?UTF-8?Q?_is_non=2Dcorrect_in_terminal?= Date: Mon, 29 Oct 2018 22:11:57 +0100 Lines: 35 Approved: bug-bash@gnu.org Message-ID: References: <36e7d390-36d9-6b34-668f-bafb9b1885e5@iki.fi> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: usenet.stanford.edu 1540847536 4158 208.118.235.17 (29 Oct 2018 21:12:16 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: itvirta@iki.fi Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Mcj7i4UirRSpZ0m6/PUDvvsRAL2AtpwgseiDOtZyiYE=; b=mG04Z6jEiGbf5TUINKBG8Z30IncH1NqHjLatmeEBF89z9KurtyN0zZrvuAKzy+wyUJ 286Ck43cE0VFXSMC78EPTWrvH4PTEqWTThCkzrP6ROhRmLdMFv1aO3y5eV7e9G8OTKiQ M3Pnv4bI795cIHDIQkJpLSvqdf2U91i9PD3MijoyzB5cgZpYAZXMu7/7NSAiWmCPQcRO 9AJLGxfewtKJVxr9UHZcDKgN53a16wel4fFy3iFlDRaDr7armJ9Qet33SHGnIAzmEl+1 iD+zZ/2bsavC3ZDdY9UpvsOtmwHe9TeuBiJl1cmPzvWDwgC5BFyEMt4skuCtIjAYBafh HeVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Mcj7i4UirRSpZ0m6/PUDvvsRAL2AtpwgseiDOtZyiYE=; b=mE0Y0E3Vr2E9HzGappuNgpDLnH6Hxj5Paop5DhAn64MrbhaM5E3zhuXqQQ4MkWqFpJ SknOmxjYPlm06iRZVmu8MheMMr2IONDqxnpbeKbqmaLqQAmyZj/KVrhU/bHIhPVgCG+Q yDyBjIvUruHj3AetQklinzYT/n+TZa77D3/sqkX/3ZMYAdlWngkV0qge1OQGqi/YUa+n 3pRh6OZBcECOPUfFRWaU0XjHGeRQzMWQDGFY1hOB6uBz9lw71uzJxCGUe6HsUI0MPO+w pYjV1rkuDa1Qyj0pSSSbFiTkOsRfwi66yA30AscUZUIosvTyCYN70Cr0oyKAbMIyhcw+ ltCQ== X-Gm-Message-State: AGRZ1gKXEkZGCOhKZQbw+Owk8ifWu9l7kaCQs1pYffAmf0JyRYszsJlt PWfdSc1FByKHaKiZogHSrUx777j59iTJhrpUxIBrYuzO X-Google-Smtp-Source: AJdET5eUhLDWJmku4gW+9Pj5rLCeMYBxgKfVl+fVzr2J5+RMO4M1pgWS66Lk5WJClQil84vUXT9URNGDcLv8iraNbw4= X-Received: by 2002:a9d:5b2d:: with SMTP id x42mr2046506oth.13.1540847530206; Mon, 29 Oct 2018 14:12:10 -0700 (PDT) In-Reply-To: <36e7d390-36d9-6b34-668f-bafb9b1885e5@iki.fi> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32d X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14745 Awesome, thanks! ma 29. lokak. 2018 klo 13.57 Ilkka Virta (itvirta@iki.fi) kirjoitti: > On 29.10. 12:40, Ricky Tigg wrote: > > Actual result: > > > > $ curl https://www.startpage.com > > (...) [yk@localhost ~]$ > > The shell just prints the prompt where ever the cursor was left. That's > quite common, the only exception I know is zsh, which moves the cursor > to the start of line if the previous command didn't leave it in the left > edge. > > A simple workaround would be to add '\n' at the start of the prompt, but > it would then print an empty line above the prompt for every command > that does properly finish the output with a newline. Some might find > that ugly. > > It might be possible to check for that manually in PROMPT_COMMAND. > Something like this seems to mostly work for me in interactive use, > though it's rather stupid and will probably break down at some point. > > prompt_to_bol() { local pos; printf '\e[6n'; read -sdR pos; > [[ ${pos#*;} != 1 ]] && printf '\e[30;47m%%\n\e[0m'; } > PROMPT_COMMAND=prompt_to_bol > > (I stole the main parts from the answers in > https://unix.stackexchange.com/q/88296/170373 ) > > > -- > Ilkka Virta / itvirta@iki.fi >