Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commands: Do not try to escape quotes #1622

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jul 25, 2023

  1. commands: Do not try to escape quotes

    Using re.sub(r'"(.*)"', r'"\\"\1\\""', cmdline) is wrong, as it would
    not work if we have multiple quoted fragments in the command line, for
    example: `search subject:"foo bar" and date:"this month"`.
    
    Furthermore, there are other places using split_commandstring() - doing
    the escaping in just one place does not sound very consistent.
    
    Just let shlex do its job. It is possible to use single quotes when
    needed. Using the example above, we can simply do `search subject:'"foo
    bar"' and date:'"this month"'`, which is what we would normally do when
    using notmuch from a shell.
    guludo committed Jul 25, 2023
    Configuration menu
    Copy the full SHA
    04b0e21 View commit details
    Browse the repository at this point in the history