Execute system commands via hotkeys or command palette in Obsidian (https://obsidian.md). Some automated events are also supported, and execution via URI links.
GNU General Public License v3.0
365
stars
12
forks
source link
Turning off 'Preview variables' setting leaves old previews to command palette #45
I have the following kind of test shell command, and I have Preview variables in command palette turned off.
I first had the setting turned on, during which time I opened up the command palette and saw the {{date}} variable correctly parsed like this:
The issue is that when I went to turn off the setting, and reopened the command palette, the old preview text still appeared, and had an old time in it.
I then changed the command from echo {{date:HH:mm:ss}} to echo {{date:HH:mm:ss}} >> SomeFile.md. If I execute the command, then it's executed with the old value as shown in the preview (for the first execution). This can be bad. After the first execution, subsequent executions will not use stale values anymore, they will use correctly up-to-date values, but the preview text is still the same old one.
If the setting is turned off the whole time since starting Obsidian, this bug does not occur, because previews are not generated at any point. So, a workaround is to restart Obsidian.
I have the following kind of test shell command, and I have Preview variables in command palette turned off.
I first had the setting turned on, during which time I opened up the command palette and saw the
{{date}}
variable correctly parsed like this:The issue is that when I went to turn off the setting, and reopened the command palette, the old preview text still appeared, and had an old time in it.
I then changed the command from
echo {{date:HH:mm:ss}}
toecho {{date:HH:mm:ss}} >> SomeFile.md
. If I execute the command, then it's executed with the old value as shown in the preview (for the first execution). This can be bad. After the first execution, subsequent executions will not use stale values anymore, they will use correctly up-to-date values, but the preview text is still the same old one.If the setting is turned off the whole time since starting Obsidian, this bug does not occur, because previews are not generated at any point. So, a workaround is to restart Obsidian.