jjui icon indicating copy to clipboard operation
jjui copied to clipboard

Leader key variable substitution flakey

Open jscarrott opened this issue 2 months ago • 3 comments

Description

In the current main version, my custom leader key config doesn't work, failing with


[leader.n]
context = ["$change_id"]
help = "Conventional Commit"
send = [ "$", "jjdi $change_id", "enter"]

/bin/bash: line 1: change_id: command not found

jjui: press enter to continue...

this however still works:

[leader.n]
context = ["$change_id"]
help = "Conventional Commit"
send = [ "$", "jjdi \"$change_id\" ", "enter"]

Note the extra quotes and the trailing space. Without the trailing space, the final quote is ignored, and the script fails with mismatched quotes.

Specifications

  • Platform: fish and bash
  • Version: v0.9.4-0.20251007080218-5ef8eb8e7894

jscarrott avatar Oct 07 '25 15:10 jscarrott

Hey thanks for the report.

Let me see what I can do but Leader and custom commands are going away in the next release so I prefer investing time into getting next version ready rather fixing these at the moment.

idursun avatar Oct 07 '25 19:10 idursun

Yeah, the behavior is actually very odd. It seems my workaround doesn't work consistently which makes me think there is some kind of race condition that might be hard to track down.

jscarrott avatar Oct 08 '25 13:10 jscarrott

hey @idursun @jscarrott

since there's no plan to get this fixed, i updated the wiki instead to avoid confusion https://github.com/idursun/jjui/wiki/Leader-Key/34a7ef95bf58b2c5f2e97b5c127658309e5771e9

baggiiiie avatar Oct 25 '25 08:10 baggiiiie