[asterisk-bugs] [Asterisk 0015929]: [patch] CLI to honor user's ~/.editrc file
Asterisk Bug Tracker
noreply at bugs.digium.com
Tue Sep 22 17:37:30 CDT 2009
A NOTE has been added to this issue.
======================================================================
https://issues.asterisk.org/view.php?id=15929
======================================================================
Reported By: kkm
Assigned To:
======================================================================
Project: Asterisk
Issue ID: 15929
Category: General
Reproducibility: N/A
Severity: feature
Priority: normal
Status: feedback
Asterisk Version: 1.6.1.5
JIRA:
Regression: No
SVN Branch (only for SVN checkouts, not tarball releases): N/A
SVN Revision (number only!):
Request Review:
======================================================================
Date Submitted: 2009-09-22 03:25 CDT
Last Modified: 2009-09-22 17:37 CDT
======================================================================
Summary: [patch] CLI to honor user's ~/.editrc file
Description:
Asterisk CLI ignores command line keybinding file ~/.editrc. By default,
Home, End and Delete keys are not bound to meaningful commands. The
attached simple patch fixes that, in such a way that:
1. If the environment variable EDITRC is set, it is taken to point to an
alternative bindings file.
2. Otherwise, if HOME is set, the file is looked up in ${HOME}/.editrc
If exists, the file is processed by the editline library el_source()
function.
The following sample .editrc file binds Home and End to move to the
beginning and end of command line respectively, Delete to delete character
right, and C-left and C-right to move by word:
bind \\e[3~ ed-delete-next-char
bind \\e[1~ ed-move-to-beg
bind \\e[4~ ed-move-to-end
bind \\eOC vi-next-space-word
bind \\eOD vi-prev-space-word
======================================================================
----------------------------------------------------------------------
(0111234) kkm (reporter) - 2009-09-22 17:37
https://issues.asterisk.org/view.php?id=15929#c111234
----------------------------------------------------------------------
Yes that can be done (or in addition to). This is less in line with general
support of different terminals and keyboards by programs.
In support of my approach: (a) Asterisk uses generic library that many
other programs use, but initializes it rather improperly and thus ignores a
common rc file. (b) Hardcoding terminal escape sequences is not as good as
allowing them to be configurable
In support of your approach: (a) Not many programs really use editline;
readline is used far more often, and that one uses different rc file with
different syntax (~/.inputrc) (b) Who uses terminals with non-VT100
keyboard codes, anyhow?
So, what do you think? I find the arguments of the both sides valid and
reasonable.
Issue History
Date Modified Username Field Change
======================================================================
2009-09-22 17:37 kkm Note Added: 0111234
======================================================================
More information about the asterisk-bugs
mailing list