1

Is there any way (supported or otherwise) to set Readline's rl_readline_name variable from Ruby's Readline module? Or even to read it to find out the current value?

It seems to be only marginally documented and supported in the C library, with about the only mention being how to use the value in .inputrc to conditionalise settings.

9
  • 1
    is it just "Ruby"? github.com/ruby/ruby/blob/v3_2_3/ext/readline/readline.c#L1934 Commented Jan 28, 2024 at 20:43
  • Yes it is, although I had to insert an $if Ruby/$endif definition in .inputrc to verify it. Meh. It looks as though that cell isn't exposed through the Ruby bindings, but I haven't finished searching. Thanks for the find! Commented Jan 28, 2024 at 21:47
  • maybe if you could explain what's your end goal is here, there might be other solutions. Commented Jan 29, 2024 at 0:47
  • First goal is to be able to set the application name so I can add application-specific customisations to .inputrc. Second goal is to make the Ruby interface more closely resemble the underlying C interface. Commented Jan 29, 2024 at 3:16
  • it doesn't look like rl_readline_name is meant to be set by the end user (example), you could use INPUTRC env var to load a different .inputrc file. you could use Reline which is the default ruby implementation of readline now and patch this part to maybe set application name from env. Commented Jan 29, 2024 at 4:18

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.