Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14745 > unrolled thread
| Started by | Ricky Tigg <ricky.tigg@gmail.com> |
|---|---|
| First post | 2018-10-29 22:11 +0100 |
| Last post | 2018-10-29 22:11 +0100 |
| 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: GNUbash v. 4.4.23-5 – Bash identifier location is non-correct in terminal Ricky Tigg <ricky.tigg@gmail.com> - 2018-10-29 22:11 +0100
| From | Ricky Tigg <ricky.tigg@gmail.com> |
|---|---|
| Date | 2018-10-29 22:11 +0100 |
| Subject | Re: GNUbash v. 4.4.23-5 – Bash identifier location is non-correct in terminal |
| Message-ID | <mailman.3037.1540847536.1284.bug-bash@gnu.org> |
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
>
Back to top | Article view | gnu.bash.bug
csiph-web