Restrict mode prefixes for cmd-history (#1971)
This commit is contained in:
1 parent
40770d7dee
commit
6616c9c119
1 file changed
+2
-2
@@ -2009,7 +2009,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
log.Printf("entering unknown execution prefix: %q", app.ui.cmdPrefix)
|
||||
}
|
||||
case "cmd-history-next":
|
||||
if app.ui.cmdPrefix == "" || app.ui.cmdPrefix == ">" {
|
||||
if !slices.Contains([]string{":", "$", "!", "%", "&"}, app.ui.cmdPrefix) {
|
||||
return
|
||||
}
|
||||
if app.cmdHistoryInd > 0 {
|
||||
@@ -2027,7 +2027,7 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
app.ui.cmdPrefix = cmd.prefix
|
||||
app.ui.cmdAccLeft = []rune(cmd.value)
|
||||
case "cmd-history-prev":
|
||||
if app.ui.cmdPrefix == ">" {
|
||||
if !slices.Contains([]string{":", "$", "!", "%", "&", ""}, app.ui.cmdPrefix) {
|
||||
return
|
||||
}
|
||||
if app.cmdHistoryInd == len(app.cmdHistory) {
|
||||
|
||||
Reference in new issue
Block a user