Work>work chooses its own task and merges from the interface; panes find their tools; shell follows the project folder

This commit is contained in:
Sam
2026-11-11 12:02:12 +11:00
parent 678c497064
commit 7198c34e42
13 changed files with 441 additions and 15 deletions

View File

@@ -14,6 +14,20 @@ import sys
import urllib.error
import urllib.request
# A program started from a TUIOS pane gets a smaller PATH than an interactive
# shell, so the places a person's tools actually live are added before anything
# is looked for. Without this, ocr is "not installed" inside a merge.
_HOME = os.path.expanduser("~")
_USER = os.environ.get("USER", "")
for _p in (
os.path.join(_HOME, ".local", "bin"),
os.path.join(_HOME, ".nix-profile", "bin"),
"/run/current-system/sw/bin",
"/etc/profiles/per-user/" + _USER + "/bin",
):
if _p not in os.environ.get("PATH", ""):
os.environ["PATH"] = _p + ":" + os.environ.get("PATH", "")
API = os.environ.get("PAPERCLIP_API_URL", "http://127.0.0.1:3100").rstrip("/")
COMPANY = os.environ.get("PAPERCLIP_COMPANY_ID", "d4921013-e5da-4d88-8016-57d5746e2d03")
KEY = os.environ.get("PAPERCLIP_BOARD_KEY", "")

View File

@@ -157,6 +157,14 @@ def arrange(order, session=None):
return moved
def window_cwd(name, session=None):
"""The working directory of a named pane, as TUIOS reports it."""
for w in windows(session):
if (w.get("custom_name") or "") == name:
return w.get("cwd") or ""
return ""
def close_pane(name, session=None):
for w in windows(session):
if (w.get("custom_name") or "") == name: