leahneukirchen / mblaze

Unix utilities to deal with Maildir
Other
447 stars 48 forks source link

contrib/mmailto: Fix using longer arguments #258

Open rakoo opened 5 months ago

rakoo commented 5 months ago

We put the args to $TERMINAL inside single quotes for terminals that want a single command, and we put arguments extracted from the adress between double quotes to protect from spaces.

This is necessary for xfce4-terminal for example, and doesn't break xterm

leahneukirchen commented 3 weeks ago

Regarding the original patch: since we set IFS, I don't think this is necessary?

rakoo commented 3 weeks ago

Ah, sorry about the unrelated stuff I added by mistake.

After further testing, if I understand correctly, it seems that xfce4-terminal must have arguments after -e inside quotes, and when adding quotes the newlines don't seem to work anymore. Going back to args within quotes make it work, but it might not be the prettiest solution, I'll admit.

-- Matthieu Rakotojaona

leahneukirchen commented 3 weeks ago

Try xfce4-terminal -x ... instead. IMO this is an upstream bug, I don't know why they don't implement -e like other terminal emulators.

gnome-terminal just uses -- these days, so perhaps we should make the flag configurable/detect it.

rakoo commented 3 weeks ago

I don't think upstream will change the way it works, so I'll just keep a personal diff locally. The idea of configuring the flag is worth a try for the future.

Closing this PR now.

-- Matthieu Rakotojaona