Skip to content

Commit

Permalink
Unblock GUI browsers on WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Jun 14, 2020
1 parent 9d62886 commit 502b517
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
7 changes: 5 additions & 2 deletions buku
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import collections
import json
import logging
import os
import platform
import re
import shutil
import signal
Expand Down Expand Up @@ -4353,7 +4354,8 @@ def browse(url):
_stderr = os.dup(2)
os.close(2)
_stdout = os.dup(1)
os.close(1)
if "microsoft" not in platform.uname()[3].lower():
os.close(1)
fd = os.open(os.devnull, os.O_RDWR)
os.dup2(fd, 2)
os.dup2(fd, 1)
Expand All @@ -4374,7 +4376,8 @@ def browse(url):
if browse.suppress_browser_output:
os.close(fd)
os.dup2(_stderr, 2)
os.dup2(_stdout, 1)
if "microsoft" not in platform.uname()[3].lower():
os.dup2(_stdout, 1)

if browse.override_text_browser:
browse.suppress_browser_output = browser_output
Expand Down
9 changes: 9 additions & 0 deletions packagecore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ packages:
- python3-certifi
- python3-cryptography
- python3-urllib3
opensuse.tumbleweed:
builddeps:
- make
deps:
- python3
- python3-beautifulsoup4
- python3-certifi
- python3-cryptography
- python3-urllib3
ubuntu14.04:
builddeps:
- make
Expand Down

0 comments on commit 502b517

Please sign in to comment.