File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,25 @@ const localXdgOpenPath = path.join(__dirname, 'xdg-open');
10
10
11
11
const { platform, arch} = process ;
12
12
13
+ // Podman detection
14
+ const hasContainerEnv = ( ) => {
15
+ try {
16
+ fs . statSync ( '/run/.containerenv' ) ;
17
+ return true ;
18
+ } catch {
19
+ return false ;
20
+ }
21
+ } ;
22
+
23
+ let cachedResult ;
24
+ function isInsideContainer ( ) {
25
+ if ( cachedResult === undefined ) {
26
+ cachedResult = hasContainerEnv ( ) || isDocker ( ) ;
27
+ }
28
+
29
+ return cachedResult ;
30
+ }
31
+
13
32
/**
14
33
Get the mount point for fixed drives in WSL.
15
34
@@ -120,7 +139,7 @@ const baseOpen = async options => {
120
139
if ( app ) {
121
140
cliArguments . push ( '-a' , app ) ;
122
141
}
123
- } else if ( platform === 'win32' || ( isWsl && ! isDocker ( ) && ! app ) ) {
142
+ } else if ( platform === 'win32' || ( isWsl && ! isInsideContainer ( ) && ! app ) ) {
124
143
const mountPoint = await getWslDrivesMountPoint ( ) ;
125
144
126
145
command = isWsl ?
You can’t perform that action at this time.
0 commit comments