diff --git a/doc/rofi-manpage.markdown b/doc/rofi-manpage.markdown index 59894ed1..87472554 100644 --- a/doc/rofi-manpage.markdown +++ b/doc/rofi-manpage.markdown @@ -519,7 +519,8 @@ The following options are further explained in the theming section: * 's' selected string. * 'i' index (0 - (N-1)). * 'd' index (1 - N). - * 'e' selected string escaped. + * 'q' quote string. + * 'e' escape string. Default: 's' diff --git a/doc/rofi.1 b/doc/rofi.1 index 77e4c267..4d7c8f8d 100644 --- a/doc/rofi.1 +++ b/doc/rofi.1 @@ -678,7 +678,8 @@ Allows the output of dmenu to be customized (N is total number of input entries) * 's' selected string. * 'i' index (0 \- (N\-1)). * 'd' index (1 \- N). - * 'e' selected string escaped. + * 'q' quote string. + * 'e' escape string. Default: 's' .fi .RE diff --git a/source/dialogs/dmenu.c b/source/dialogs/dmenu.c index 5a076b8a..1f407956 100644 --- a/source/dialogs/dmenu.c +++ b/source/dialogs/dmenu.c @@ -154,11 +154,16 @@ static void dmenu_output_formatted_line ( const char *format, const char *string else if ( format[i] == 's' ) { fputs ( string, stdout ); } - else if ( format[i] == 'e' ) { + else if ( format[i] == 'q' ) { char *quote = g_shell_quote ( string ); fputs ( quote, stdout ); g_free ( quote ); } + else if ( format[i] == 'e' ) { + char *quote = g_strescape ( string, "" ); + fputs ( quote, stdout ); + g_free ( quote ); + } else { fputc ( format[i], stdout ); }