jarun / ddgr

:duck: DuckDuckGo from the terminal
GNU General Public License v3.0
2.92k stars 139 forks source link

Results don't open if BROWSER var contains option #127

Closed rpolve closed 2 years ago

rpolve commented 3 years ago

description

It would seem that only one-word commands are supported when launching the browser. This behaviour forbids the user from using option flags.

wrong behaviour

Setting the BROWSER var to more than one world silently prevents from opening the result page.

expected behaviour

I should be able to use my preferred browser's option flags.

logs

working

[DEBUG] ddgr version 1.9 Python version 3.7.3
[DEBUG] q:wikipedia, region:us-en, page:0, curindex:1, safe:1
[DEBUG] nextParams:
[DEBUG] vqd:
[DEBUG] proxy:{'https': None}
[DEBUG] ua:ddgr/1.9 (textmode; Linux x86_64; 1024x768)
[DEBUG] Response body written to '/tmp/ddgr-response-4bg672ji'.
[DEBUG] Prev nextParams:
[DEBUG] Next nextParams:
[DEBUG] VQD: 3-285410119986133957514072786051468542921-256931098327655983058967847324763329434
[DEBUG] Opening https://www.wikipedia.org/

Exiting via interrupt: 2

not working

[DEBUG] ddgr version 1.9 Python version 3.7.3
[DEBUG] q:wikipedia, region:us-en, page:0, curindex:1, safe:1
[DEBUG] nextParams:
[DEBUG] vqd:
[DEBUG] proxy:{'https': None}
[DEBUG] ua:ddgr/1.9 (textmode; Linux x86_64; 1024x768)
[DEBUG] Response body written to '/tmp/ddgr-response-773_c8m9'.
[DEBUG] Prev nextParams:
[DEBUG] Next nextParams:
[DEBUG] VQD: 3-285410119986133957514072786051468542921-256931098327655983058967847324763329434
[DEBUG] Opening https://en.wikipedia.org/

version

I tested both v1.9 and trunk versions.

f3580a4 (HEAD -> main, origin/main, origin/HEAD) Fix build break

system

Python 3.7.3
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10
Codename:       buster
Linux raspi 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l GNU/Linux
jarun commented 2 years ago

The env option BROWSER is a standard python thing. Doesn't look like it handles args - https://docs.python.org/3/library/webbrowser.html