#3261·ranger

Show a warning on incorrect macro usage in `:console` command

Author: hutCreated Aug 7, 2026Updated Sep 6, 2026
Labelsdoc-issue

Ranger should display a warning if the user has a key binding that uses :console followed by %s, because it will resolve the macro at the wrong/unexpected time: during the call of :console, not during the call of the command whichever is following console.

The warning should explain the proper way to do this, which is using %%s instead of %s.

See https://github.com/ranger/ranger/issues/1734#issuecomment-5208042939

Example for correct command (from ranger's rc.conf):

map @ console -p6 shell %%s

Example for a dangerous command:

map X console shell rm -rf %s

If the files in %s contain spaces or other special characters, it will mess with the command. For example, if %s is a directory called 'My Documents', typing the X key would make it expand to:

:shell rm -rf My Documents

which would delete 2 directories/files called My and Documents, not the directory/file My Documents.