Expand ~ and env vars in program names. Fixes #483
This commit is contained in:
+4
-4
@@ -8,7 +8,6 @@ import fcntl
|
||||
import math
|
||||
import os
|
||||
import re
|
||||
import shlex
|
||||
import socket
|
||||
import string
|
||||
import subprocess
|
||||
@@ -111,10 +110,11 @@ def base64_encode(
|
||||
|
||||
|
||||
def command_for_open(program='default'):
|
||||
if program == 'default':
|
||||
if isinstance(program, str):
|
||||
from .config_utils import to_cmdline
|
||||
program = to_cmdline(program)
|
||||
if program == ['default']:
|
||||
cmd = ['open'] if is_macos else ['xdg-open']
|
||||
else:
|
||||
cmd = shlex.split(program)
|
||||
return cmd
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user