pokemon-terminal-theme 1.3.8 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ichooseyou
CHANGED
|
@@ -11,7 +11,11 @@ const mainScript = path.join(__dirname, 'pokemonterminal', 'main.py');
|
|
|
11
11
|
// Spawn the Python process
|
|
12
12
|
const child = spawn(pythonExecutable, [mainScript, ...process.argv.slice(2)], {
|
|
13
13
|
stdio: 'inherit',
|
|
14
|
-
cwd: __dirname
|
|
14
|
+
cwd: __dirname,
|
|
15
|
+
env: {
|
|
16
|
+
...process.env,
|
|
17
|
+
PYTHONPATH: __dirname
|
|
18
|
+
}
|
|
15
19
|
});
|
|
16
20
|
|
|
17
21
|
child.on('exit', (code) => {
|
package/package.json
CHANGED
package/pokemon
CHANGED
|
@@ -11,7 +11,11 @@ const mainScript = path.join(__dirname, 'pokemonterminal', 'main.py');
|
|
|
11
11
|
// Spawn the Python process
|
|
12
12
|
const child = spawn(pythonExecutable, [mainScript, ...process.argv.slice(2)], {
|
|
13
13
|
stdio: 'inherit',
|
|
14
|
-
cwd: __dirname
|
|
14
|
+
cwd: __dirname,
|
|
15
|
+
env: {
|
|
16
|
+
...process.env,
|
|
17
|
+
PYTHONPATH: __dirname
|
|
18
|
+
}
|
|
15
19
|
});
|
|
16
20
|
|
|
17
21
|
child.on('exit', (code) => {
|
|
Binary file
|
package/pokemonterminal/main.py
CHANGED
|
@@ -7,7 +7,7 @@ import sys
|
|
|
7
7
|
from multiprocessing import Process
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
|
|
10
|
-
import scripter, slideshow
|
|
10
|
+
from pokemonterminal import scripter, slideshow
|
|
11
11
|
from pokemonterminal.command_flags import parser, is_slideshow
|
|
12
12
|
from pokemonterminal.database import Database
|
|
13
13
|
from pokemonterminal.filters import Filter
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import os
|
|
3
3
|
import re
|
|
4
|
+
import psutil
|
|
4
5
|
|
|
5
6
|
from pokemonterminal.terminal.adapters import TerminalProvider as _TProv
|
|
6
7
|
|
|
@@ -48,7 +49,19 @@ class WindowsTerminalProvider(_TProv):
|
|
|
48
49
|
return re.sub(pattern, replacer, text)
|
|
49
50
|
|
|
50
51
|
def is_compatible() -> bool:
|
|
51
|
-
|
|
52
|
+
# Check environment variables first (most reliable)
|
|
53
|
+
if "WT_SESSION" in os.environ or "WT_PROFILE_ID" in os.environ:
|
|
54
|
+
return True
|
|
55
|
+
|
|
56
|
+
# Fallback: check parent process name
|
|
57
|
+
try:
|
|
58
|
+
parent = psutil.Process().parent()
|
|
59
|
+
if parent and parent.name().lower() in ['windowsterminal.exe', 'wt.exe']:
|
|
60
|
+
return True
|
|
61
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
62
|
+
pass
|
|
63
|
+
|
|
64
|
+
return False
|
|
52
65
|
|
|
53
66
|
def change_terminal(path: str):
|
|
54
67
|
WindowsTerminalProvider.set_background_image(path)
|