File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change 134134
135135(defn- bind-from-capability!
136136 " Bind a key from terminal capability, stripping ESC prefix.
137- Returns nil if terminal is nil."
137+ Returns nil if terminal is nil or capability not found ."
138138 [^KeyMap keymap ^Terminal terminal ^InfoCmp$Capability cap event]
139139 (when terminal
140- (when-let [seq (KeyMap/key terminal cap)]
141- ; ; JLine's key() returns the full sequence including ESC
142- ; ; We need to strip the ESC since we read sequences after ESC
143- (let [seq-str (String. ^chars seq)]
144- (when (and (pos? (count seq-str))
145- (= (int (first seq-str)) 27 ))
146- (bind-key! keymap (subs seq-str 1 ) event))))))
140+ ; ; JLine's getStringCapability returns the full sequence including ESC
141+ ; ; We need to strip the ESC since we read sequences after ESC
142+ (when-let [seq-str (.getStringCapability terminal cap)]
143+ (when (and (pos? (count seq-str))
144+ (= (int (first seq-str)) 27 ))
145+ (bind-key! keymap (subs seq-str 1 ) event)))))
147146
148147(defn- bind-fallback-sequences!
149148 " Bind fallback sequences for a key."
You can’t perform that action at this time.
0 commit comments