Files
vterm/main.py
Vaclav Tvrdik 2715ecddbb Report a failed spawn, drop the paste wrapper and the unbound close command, sync docs
- vterm_open shows an error dialog when the command cannot start,
  instead of a tab that silently vanishes
- on_text_command hands paste straight to vterm_paste_text;
  VtermPasteCommand only forwarded
- VtermCloseCommand was bound nowhere; closing the tab already kills
  the process
- wheel_lines fallback matches the shipped 1; README said three
- Architecture.md: per-theme scheme files and managers, command table
2026-10-25 10:41:29 +01:00

51 lines
1.4 KiB
Python

""" vterm plugin entry point
Submodules are deliberately not purged on reload: rebuilding the terminal
registry would orphan open terminal tabs.
"""
import logging
import sublime
# imported for sublime's command discovery, not called here
from .vterm.commands import (
VtermClearScreenCommand,
VtermClearUndoStackCommand,
VtermCleanupCommand,
VtermCopyCommand,
VtermInitializeViewCommand,
VtermKeypressCommand,
VtermNoopCommand,
VtermOpenCommand,
VtermOpenTerminalProjectFolderCommand,
VtermPasteSelectionCommand,
VtermPasteTextCommand,
VtermSelectThemeCommand,
)
from .vterm.listeners import VtermCoreEventListener
from .vterm.mouse import (
VtermMousePressCommand,
VtermMouseReleaseCommand,
VtermScrollCommand,
)
from .vterm.scheme import build_startup_schemes
from .vterm.utils import settings
from .vterm.render import (
VtermRenderCommand,
VtermShowCursorCommand,
)
def plugin_loaded():
"""Write any missing theme's colour scheme and set the log level, once per
plugin host: a restored tab's color_scheme is read during startup and may
name any of them.
"""
window = sublime.active_window()
view = window.active_view() if window else None
build_startup_schemes(view)
level = logging.DEBUG if settings().get("debug", False) else logging.INFO
logging.basicConfig()
logging.getLogger("vterm").setLevel(level)