pokemon-terminal-theme 1.3.9 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pokemon-terminal-theme",
3
- "version": "1.3.9",
3
+ "version": "1.4.0",
4
4
  "description": "Pokemon terminal themes",
5
5
  "bin": {
6
6
  "pokemon": "pokemon",
@@ -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
- return "WT_SESSION" in os.environ
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)