- Subject: Re: [slang-users] Anybody listening?
- From: jed@xxxxxxxxxxx (John E. Davis)
- Date: Mon, 19 Aug 2019 13:32:48 -0400
> I'm writing S-Lang scripts on MS Linux, so it's just slsh, no embedding.
> (Have used Lua before, which is also a nice language, but completely
> without "batteries").
If you know what escape sequences the keys that you want to bind
generate, or if your terminfo database for your terminal contain this
information, the you could define the keybindings in your $HOME/.slrlinerc
file. Here is a simple example of such a file:
% Load some basic functions that implement the history mechanism
() = evalfile ("rline/slrline.rc");
% The name of the history file -- expands to .slsh_hist for slsh
RLine_History_File = "$HOME/.${name}_hist";
RLine_Hist_Max_Lines = 1000;
% Bind the home/end keys to move to the beginning/end of the line
% See `man 5 termcap`
rline_setkey("bol", "^(kh)"); % Home (terminfo db)
rline_setkey("eol", "^(@7)"); % End (terminfo db)
rline_setkey("bol", "\e[7~"); % Home (esc seq)
rline_setkey("eol", "\e[8~"); % End (esc seq)
This file is described in the slsh manpage.
I hope this helps.
--John
_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.
[2019 date index]
[2019 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]