@@ -40,8 +40,8 @@ def __init__(
4040 self .envs = envs
4141 self .chdir = chdir
4242 self .clear_env = clear_env
43- self .share_paths_ro = share_paths_ro
44- self .share_paths_rw = share_paths_rw
43+ self .share_paths_ro = list ( share_paths_ro or [])
44+ self .share_paths_rw = list ( share_paths_rw or [])
4545 self .share_net = share_net
4646 self .share_user = share_user
4747 self .share_host_ro = share_host_ro
@@ -74,7 +74,7 @@ def __get_bwrap(self, cmd: str):
7474
7575 if self .share_paths_rw :
7676 _cmd += [
77- f"--bind { shlex .quote (p )} { shlex .quote (p )} " for p in self .share_paths_ro
77+ f"--bind { shlex .quote (p )} { shlex .quote (p )} " for p in self .share_paths_rw
7878 ]
7979
8080 if self .share_sound :
@@ -95,21 +95,21 @@ def __get_bwrap(self, cmd: str):
9595 return _cmd
9696
9797 def __get_flatpak_spawn (self , cmd : str ):
98- _cmd = ["flatpak-spawn" ]
98+ _cmd = ["flatpak-spawn" , "--sandbox" ]
9999
100100 if self .envs :
101101 _cmd += [f"--env={ k } ={ shlex .quote (v )} " for k , v in self .envs .items ()]
102102
103- if self .share_host_ro :
104- _cmd .append ("--sandbox" )
105- _cmd .append ("--sandbox-expose-path-ro=/" )
103+ if self .clear_env :
104+ _cmd .append ("--clear-env" )
106105
107106 if self .chdir :
108- _cmd .append (f"--directory={ shlex .quote (self .chdir )} " )
109- _cmd .append (f"--sandbox-expose-path={ shlex .quote (self .chdir )} " )
107+ quoted_dir = shlex .quote (self .chdir )
108+ _cmd .append (f"--directory={ quoted_dir } " )
109+ _cmd .append (f"--sandbox-expose-path={ quoted_dir } " )
110110
111- if self .clear_env :
112- _cmd .append ("--clear-env " )
111+ if self .share_host_ro :
112+ _cmd .append ("--sandbox-expose-path-ro=/ " )
113113
114114 if self .share_paths_ro :
115115 _cmd += [
@@ -122,7 +122,8 @@ def __get_flatpak_spawn(self, cmd: str):
122122 f"--sandbox-expose-path={ shlex .quote (p )} " for p in self .share_paths_rw
123123 ]
124124
125- if not self .share_net :
125+ share_net = self .share_net or self .share_bluetooth
126+ if not share_net :
126127 _cmd .append ("--no-network" )
127128
128129 if self .share_display :
0 commit comments