davatorium / rofi

Rofi: A window switcher, application launcher and dmenu replacement
https://davatorium.github.io/rofi/
Other
13.27k stars 613 forks source link

Error in script mode when entry contains a single quote. #650

Closed donRaphaco closed 7 years ago

donRaphaco commented 7 years ago

Version

Version: 1.3.1 - 1.3.1-723-g96c70813 (master)

Configuration

Output of rofi -help: https://gist.github.com/donRaphaco/b5a80259ca19fa0663fa028301f74b04

Launch Command

rofi -modi "test:~/test.sh" -show test

Steps to reproduce

  1. create test.sh:
    
    #!/bin/bash

if [[ $@ == exit ]] then exit; fi

echo "foo'bar" echo '"' echo "'" echo 'foo"bar' echo exit


2. run rofi with: `rofi -modi "test:~/test.sh" -show test`

3. select any entry containing a single quote

## What behaviour you see

* Error message: `Failed to parse: '/bin/bash -ic '{cmd}''`

## What behaviour you expect to see

* No error message ;)
DaveDavenport commented 7 years ago

hmmm nested quotation error. and depending on user setting it needs to be escaped differently.

DaveDavenport commented 7 years ago

Can you try the next branch, see if that fixes it. I no longer use run-command + parser, I just execute the command (+ argument) directly.

donRaphaco commented 7 years ago

I tried next and yes 8a99f0b did fix the issue with the quotes. But now you can't run scripts with a predefined argument anymore, like that: rofi -modi "test1:~/test.sh mode1,~/test2:test.sh mode2" -show test1 This is quite a drawback IMO. Anyways thanks for your fast bugfix, I appreciate it. :+1:

DaveDavenport commented 7 years ago

Owh that is a new one. Never thought about doing that.

DaveDavenport commented 7 years ago

Ok.. Added another fix that should allow that again, can you try?

donRaphaco commented 7 years ago

It's all fixed now. Thanx you're great! :smiley:

github-actions[bot] commented 4 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.