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


Groups > gnu.bash.bug > #14743

Re: GNUbash v. 4.4.23-5 – Bash identifier location is non-correct in terminal

Path csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Ilkka Virta <itvirta@iki.fi>
Newsgroups gnu.bash.bug
Subject Re: GNUbash v. 4.4.23-5 – Bash identifier location is non-correct in terminal
Date Mon, 29 Oct 2018 14:35:17 +0200
Lines 31
Approved bug-bash@gnu.org
Message-ID <mailman.3001.1540816548.1284.bug-bash@gnu.org> (permalink)
References <CAM_8-CjzL77M=XjQCNKHrXpqiAZk172UjaLjAEksJuMLgzGvRQ@mail.gmail.com>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace usenet.stanford.edu 1540816549 21878 208.118.235.17 (29 Oct 2018 12:35:49 GMT)
X-Complaints-To action@cs.stanford.edu
To Ricky Tigg <ricky.tigg@gmail.com>, bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
In-Reply-To <CAM_8-CjzL77M=XjQCNKHrXpqiAZk172UjaLjAEksJuMLgzGvRQ@mail.gmail.com>
Content-Language en-US
X-SASI-RCODE 200
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; h=subject:to:references:from:message-id:date:mime-version:in-reply-to:content-type:content-transfer-encoding; s=smtp; bh=Dx3JYKG2AnBwSFat9zKHAGyGvO0F9E3ADkkBrxQhaL8=; b=IqQmNoiBxJiD4J/lTFVU1wDDULptAoO2J83fm9k+rNkbB8uCvX8Rz+RlrNGU8GEoYI+Ha84fZm2/iKTcFzJ28vGxo+SxoqbDM+Ajg8PtSDRtkFKkvm0bCRjkOGL3LJ4T6OQ2gZQpuJZx0ZeYDY7gdI+fq6vbgcnYYP8E8Izohy9jU+b1LiiQI/AtFaY+pZmjZ1hnMyeSe3KuFWH0ajtLDpvnRsNnTXGYWh2w8mOZr5g9Sls8QqQJIo/tQIuzDeTFehrGGIUPbyy6dNysZwxS7fnjofJ24B5e6mrJuJpMAjUzuQHQROiD3eHkX3fA8GYPZw/DXSaz674Bozy7qcTSJg==
X-detected-operating-system by eggs.gnu.org: FreeBSD 8.x
X-Received-From 157.24.2.104
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14743

Show key headers only | View raw


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

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: GNUbash v. 4.4.23-5 – Bash identifier location is non-correct in terminal Ilkka Virta <itvirta@iki.fi> - 2018-10-29 14:35 +0200

csiph-web