zsh-workers
 help / color / mirror / code / Atom feed
From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: "Marlon Richert" <marlon.richert@gmail.com>,
	"Zsh hackers list" <zsh-workers@zsh.org>
Subject: Re: [BUG?] $terminfo weirdness
Date: Tue, 11 May 2021 12:21:27 +0000	[thread overview]
Message-ID: <e9cab05c-76f2-46cb-8438-122343aa4e4d@www.fastmail.com> (raw)
In-Reply-To: <CAHLkEDsfa4wkVP+xGUhoQjDS630Q3e1_-VONMcaU7Wfnc6mv0g@mail.gmail.com>

Marlon Richert wrote on Tue, 11 May 2021 11:01 +00:00:
> % print -r -- ${(@kvq+)terminfo[(I)kLFT*]}
> kLFT $'\C-[[1;2D'
> % print -r -- ${(@kvq+)terminfo[(I)kLFT]}
> kLFT $'\C-[[1;2D'
> % print -r -- ${(@kvq+)terminfo[(I)kLFT5]}
> 
> % print -r -- ${(@kvq+)terminfo[kLFT5]}
> $'\C-[[1;5D'
> %
> 
> What's going on here?

That's an artifact of the fact that getting a single key from a special
hash is implemented separately to iterating the hash (getterminfo() v.
scanterminfo()).  With ${[(I)]}, scanterminfo() is used, and evidently
doesn't return "kLFT5"; without it, getterminfo() is used, and calls
tigetstr("kLFT5"), which returns the observed value.  (And by the way,
"kLFT6" and "kLFT7" work too and return \e[1;6D and \e[1;7D
respectively.)

I don't immediately see anything in the documentation of tigetstr() that
documents support for trailing counts in the actual argument.

Next time please spell out what was unexpected about the output.


  parent reply	other threads:[~2021-05-11 12:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 11:01 Marlon Richert
2021-05-11 11:20 ` Roman Perepelitsa
2021-05-11 12:21 ` Daniel Shahaf [this message]
2021-05-11 14:49   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e9cab05c-76f2-46cb-8438-122343aa4e4d@www.fastmail.com \
    --to=d.s@daniel.shahaf.name \
    --cc=marlon.richert@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).