0

In the man page for .editrc a command is shown for listing key bindings for editline. Editline is a library that is used in Python and MySQL, etc., in MacOS for command line editing.

bind

or

bind -l

I can enter one of these commands in my ~/.editrc and start an application such as Python which is bound to the editline library and get the output. However there is no indication how to obtain the list interactively from the command line.

Issuing a bind command from zsh gives a command not found error. Zsh uses its own key bindings and has a bindkey command. Bash uses readline and has a bind command but that's a builtin that's specific to Bash and readline.

How can I output the list without adding the command to .editrc?

5
  • @allan It's about listing the key bindings defined in ~/.editrc on macOS. As this is only used by 3rd party binaries like Python or MySQL there is no macOS man page for this.
    – nohillside
    Commented Jul 9, 2023 at 13:53
  • You’re correct @nohillside, I missed the macOS references in the beginning. Retracted my vote
    – Allan
    Commented Jul 9, 2023 at 14:06
  • @nohillside: "... no macOS man page..." The system install of Python 3 uses editline. Python is, of course, third-party but it's provided by Apple. There's a man page for editrc in /usr/share/man/man5/editrc.5 which I presume was part of the base install provided by Apple. I used the link in my answer because I couldn't find a link to an Apple-provided online page for it. Perhaps I should have used the FreeBSD one but it's incomplete. Here's a neutral one that's complete. Commented Jul 9, 2023 at 14:44
  • Ah right, I didn't bother to check, thanks. But how I read the man page, commands like bind can only be used in ~/.editrc: The format of each line is: [prog:]command [arg [...]], command is one of the editline(3) builtin commands, and bind is listed as one of them.
    – nohillside
    Commented Jul 9, 2023 at 14:49
  • @nohillside: I just think it's odd for a config file to produce output to stdout. The history command also does it. Commented Jul 9, 2023 at 15:37

0

You must log in to answer this question.

Browse other questions tagged .