@deepseek-harness-tui/dsh-tui 0.16.0 → 0.17.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/README.md +214 -34
- package/assets/plugin-icon.svg +13 -0
- package/assets/windows-installer.cs +308 -0
- package/assets/windows-installer.ps1 +17 -0
- package/bin/dsh-tui.js +64 -5
- package/cli/adapters/dsh/index.mjs +111 -0
- package/cli/adapters/dsh/locate.mjs +73 -0
- package/cli/adapters/dsh/management-plugin.mjs +111 -0
- package/cli/args.mjs +154 -0
- package/cli/contracts.d.ts +48 -0
- package/cli/engine.mjs +92 -0
- package/cli/entry.mjs +48 -0
- package/cli/process.mjs +118 -0
- package/cli/protocol.mjs +23 -0
- package/cli/schema-v1.json +33 -0
- package/cordis.patch.yml +3 -1
- package/cordis.yml +3 -1
- package/guide/dsh-tui-guide/SKILL.md +1 -0
- package/guide/dsh-tui-guide/claude-backend.en.md +8 -0
- package/guide/dsh-tui-guide/claude-backend.md +5 -0
- package/guide/dsh-tui-guide/cli.en.md +114 -0
- package/guide/dsh-tui-guide/cli.md +114 -0
- package/guide/dsh-tui-guide/configuration.en.md +6 -5
- package/guide/dsh-tui-guide/configuration.md +6 -5
- package/guide/dsh-tui-guide/getting-started.en.md +44 -10
- package/guide/dsh-tui-guide/getting-started.md +31 -9
- package/guide/dsh-tui-guide/interaction.en.md +22 -10
- package/guide/dsh-tui-guide/interaction.md +18 -8
- package/guide/dsh-tui-guide/plugins.en.md +35 -4
- package/guide/dsh-tui-guide/plugins.md +23 -2
- package/guide/dsh-tui-guide/user-guide.en.md +30 -23
- package/guide/dsh-tui-guide/user-guide.md +29 -22
- package/lib/settings.json +83 -40
- package/lib/types/adapter/channel/plugins.d.ts.map +1 -1
- package/lib/types/adapter/channel/plugins.js +8 -0
- package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +3 -0
- package/lib/types/adapter/ports/channel-display.d.ts +10 -0
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-session.d.ts +2 -0
- package/lib/types/adapter/ports/channel-session.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +20 -0
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +17 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +8 -1
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +7 -0
- package/lib/types/adapter/ports/channel.d.ts.map +1 -1
- package/lib/types/agent/capabilities.d.ts +2 -0
- package/lib/types/agent/capabilities.d.ts.map +1 -1
- package/lib/types/agent/events.d.ts +8 -0
- package/lib/types/agent/events.d.ts.map +1 -1
- package/lib/types/api.d.ts +2 -2
- package/lib/types/api.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/events.d.ts.map +1 -1
- package/lib/types/backends/claude/translate/events.js +2 -1
- package/lib/types/backends/codex/auth/status.js +1 -1
- package/lib/types/backends/codex/session/controls.d.ts.map +1 -1
- package/lib/types/backends/codex/session/controls.js +6 -5
- package/lib/types/backends/codex/session/goals.d.ts.map +1 -1
- package/lib/types/backends/codex/session/side-query.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/events.d.ts.map +1 -1
- package/lib/types/backends/codex/translate/events.js +3 -1
- package/lib/types/backends/shared/channel-tokens.d.ts.map +1 -1
- package/lib/types/backends/shared/channel-tokens.js +9 -8
- package/lib/types/channel/history-restore.d.ts.map +1 -1
- package/lib/types/channel/history-restore.js +2 -0
- package/lib/types/channel/interaction.d.ts.map +1 -1
- package/lib/types/channel/interaction.js +1 -0
- package/lib/types/channel/projection.d.ts +1 -1
- package/lib/types/channel/projection.d.ts.map +1 -1
- package/lib/types/channel/projection.js +19 -4
- package/lib/types/channel/questions.d.ts +2 -0
- package/lib/types/channel/questions.d.ts.map +1 -1
- package/lib/types/channel/sanitize.d.ts +14 -0
- package/lib/types/channel/sanitize.d.ts.map +1 -1
- package/lib/types/channel/sanitize.js +55 -0
- package/lib/types/channel/working-directory.d.ts +9 -0
- package/lib/types/channel/working-directory.d.ts.map +1 -0
- package/lib/types/channel/working-directory.js +7 -0
- package/lib/types/commands.d.ts +8 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +13 -4
- package/lib/types/components/ChatTitle.d.ts +7 -0
- package/lib/types/components/ChatTitle.d.ts.map +1 -0
- package/lib/types/components/ChatTitle.js +15 -0
- package/lib/types/components/CodeBlockFrame.d.ts.map +1 -1
- package/lib/types/components/CodeBlockFrame.js +10 -5
- package/lib/types/components/CompactionStatusRow.d.ts.map +1 -1
- package/lib/types/components/CompactionStatusRow.js +24 -3
- package/lib/types/components/GoalTodoPanel.d.ts +3 -1
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +2 -2
- package/lib/types/components/Markdown.d.ts +9 -1
- package/lib/types/components/Markdown.d.ts.map +1 -1
- package/lib/types/components/Markdown.js +5 -4
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +17 -12
- package/lib/types/components/PromptInput.d.ts +13 -5
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +189 -107
- package/lib/types/components/SplitDiffView.d.ts.map +1 -1
- package/lib/types/components/SplitDiffView.js +232 -22
- package/lib/types/components/SubagentDetailScene.d.ts +3 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +5 -1
- package/lib/types/components/Whale.d.ts.map +1 -1
- package/lib/types/components/Whale.js +8 -5
- package/lib/types/components/approvals/ApprovalPanel.d.ts +1 -1
- package/lib/types/components/approvals/ApprovalPanel.d.ts.map +1 -1
- package/lib/types/components/approvals/ApprovalPanel.js +93 -11
- package/lib/types/components/bigfont.d.ts.map +1 -1
- package/lib/types/components/bigfont.js +2 -1
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +13 -6
- package/lib/types/components/previewRows.d.ts +19 -0
- package/lib/types/components/previewRows.d.ts.map +1 -0
- package/lib/types/components/previewRows.js +46 -0
- package/lib/types/components/questions/AskUserQuestionPanel.d.ts.map +1 -1
- package/lib/types/components/questions/AskUserQuestionPanel.js +75 -10
- package/lib/types/components/sessions/ForeignSessionRow.d.ts +3 -9
- package/lib/types/components/sessions/ForeignSessionRow.d.ts.map +1 -1
- package/lib/types/components/sessions/ForeignSessionRow.js +6 -10
- package/lib/types/components/sessions/SessionListRow.d.ts +4 -9
- package/lib/types/components/sessions/SessionListRow.d.ts.map +1 -1
- package/lib/types/components/sessions/SessionListRow.js +18 -10
- package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/InfoPanel.js +4 -3
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -1
- package/lib/types/components/sidePanel/SidePanelLayout.js +5 -5
- package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/WorkspacePanel.js +19 -7
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -1
- package/lib/types/components/sidePanel/builtinPanels.js +22 -16
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +2 -1
- package/lib/types/components/sidePanel/panelMarkdown.d.ts +32 -0
- package/lib/types/components/sidePanel/panelMarkdown.d.ts.map +1 -0
- package/lib/types/components/sidePanel/panelMarkdown.js +45 -0
- package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -1
- package/lib/types/components/sidePanel/pluginPanelAdapter.js +6 -1
- package/lib/types/components/sidePanel/subagentFailureRead.d.ts +21 -0
- package/lib/types/components/sidePanel/subagentFailureRead.d.ts.map +1 -0
- package/lib/types/components/sidePanel/subagentFailureRead.js +66 -0
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -1
- package/lib/types/components/sidePanel/useSidePanel.js +24 -6
- package/lib/types/components/trajectory/MiniWake.d.ts +2 -2
- package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
- package/lib/types/components/trajectory/MiniWake.js +7 -3
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +4 -7
- package/lib/types/dsh-adapter/backend/translate.d.ts.map +1 -1
- package/lib/types/dsh-adapter/backend/translate.js +11 -1
- package/lib/types/dsh-adapter/backend-admission.d.ts +3 -3
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +18 -1
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +6 -8
- package/lib/types/dsh-adapter/channel/composer-images.d.ts +9 -1
- package/lib/types/dsh-adapter/channel/composer-images.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-images.js +111 -111
- package/lib/types/dsh-adapter/channel/composer-mentions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/composer-mentions.js +16 -10
- package/lib/types/dsh-adapter/channel/core/actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/actions.js +23 -2
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/binding-feed.js +13 -2
- package/lib/types/dsh-adapter/channel/core/compose.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/core/compose.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/compose.js +2 -0
- package/lib/types/dsh-adapter/channel/core/files.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/files.js +2 -1
- package/lib/types/dsh-adapter/channel/core/host.d.ts +14 -10
- package/lib/types/dsh-adapter/channel/core/host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/host.js +192 -13
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/core/local-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/core/local-actions.js +32 -3
- package/lib/types/dsh-adapter/channel/extensions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/extensions.js +31 -5
- package/lib/types/dsh-adapter/channel/input-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-actions.js +4 -0
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +4 -1
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +24 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-actions.js +7 -1
- package/lib/types/dsh-adapter/channel/model-selection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/model-selection.js +6 -4
- package/lib/types/dsh-adapter/channel/session-fork.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-fork.js +1 -0
- package/lib/types/dsh-adapter/channel/session-metadata.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-metadata.js +15 -2
- package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +4 -0
- package/lib/types/dsh-adapter/channel/session-resume.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-resume.js +46 -33
- package/lib/types/dsh-adapter/channel/settings-host.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/settings-host.js +10 -3
- package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +2 -2
- package/lib/types/dsh-adapter/channel/types.d.ts +13 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/liveSession.d.ts +3 -3
- package/lib/types/dsh-adapter/compat/liveSession.js +3 -3
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.d.ts.map +1 -1
- package/lib/types/dsh-adapter/compat/sessionLog.js +17 -1
- package/lib/types/dsh-adapter/contract.d.ts +6 -5
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +7 -5
- package/lib/types/dsh-adapter/effect-ledger.d.ts +1 -1
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -1
- package/lib/types/dsh-adapter/effect-ledger.js +1 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts +26 -0
- package/lib/types/dsh-adapter/experimental-bundles.d.ts.map +1 -0
- package/lib/types/dsh-adapter/experimental-bundles.js +11 -0
- package/lib/types/dsh-adapter/host-access.d.ts.map +1 -1
- package/lib/types/dsh-adapter/host-access.js +4 -0
- package/lib/types/dsh-adapter/host-contract.d.ts +1 -1
- package/lib/types/dsh-adapter/host-contract.js +2 -2
- package/lib/types/dsh-adapter/host-dsh.js +3 -3
- package/lib/types/dsh-adapter/host-entry.js +5 -3
- package/lib/types/dsh-adapter/index.d.ts +8 -4
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +9 -7
- package/lib/types/dsh-adapter/install/pnpm-profile-add.d.ts.map +1 -1
- package/lib/types/dsh-adapter/install/pnpm-profile-add.js +9 -3
- package/lib/types/dsh-adapter/panels.d.ts +21 -7
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -1
- package/lib/types/dsh-adapter/panels.js +11 -56
- package/lib/types/dsh-adapter/plugin.d.ts +81 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +318 -70
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugins-info.js +65 -10
- package/lib/types/dsh-adapter/presets.d.ts +15 -6
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +51 -12
- package/lib/types/dsh-adapter/process-exit.d.ts +1 -1
- package/lib/types/dsh-adapter/process-exit.js +1 -1
- package/lib/types/dsh-adapter/session-tools.d.ts +34 -0
- package/lib/types/dsh-adapter/session-tools.d.ts.map +1 -0
- package/lib/types/dsh-adapter/session-tools.js +39 -0
- package/lib/types/dsh-adapter/settings-sections.d.ts +18 -1
- package/lib/types/dsh-adapter/settings-sections.d.ts.map +1 -1
- package/lib/types/dsh-adapter/settings-sections.js +73 -0
- package/lib/types/dsh-adapter/status.d.ts +88 -1
- package/lib/types/dsh-adapter/status.d.ts.map +1 -1
- package/lib/types/dsh-adapter/status.js +318 -3
- package/lib/types/dsh-adapter/team-mode.d.ts +42 -33
- package/lib/types/dsh-adapter/team-mode.d.ts.map +1 -1
- package/lib/types/dsh-adapter/team-mode.js +76 -112
- package/lib/types/extensions.d.ts +1 -1
- package/lib/types/extensions.d.ts.map +1 -1
- package/lib/types/force-production-react.js +3 -3
- package/lib/types/i18n.d.ts +195 -52
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +96 -30
- package/lib/types/ink/colorize.d.ts +7 -1
- package/lib/types/ink/colorize.d.ts.map +1 -1
- package/lib/types/ink/colorize.js +29 -8
- package/lib/types/ink/components/App.d.ts +2 -1
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +10 -3
- package/lib/types/ink/components/ScrollBox.d.ts.map +1 -1
- package/lib/types/ink/components/ScrollBox.js +1 -0
- package/lib/types/ink/dom.d.ts +1 -0
- package/lib/types/ink/dom.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-program-status.d.ts +78 -0
- package/lib/types/ink/hooks/use-program-status.d.ts.map +1 -0
- package/lib/types/ink/hooks/use-program-status.js +96 -0
- package/lib/types/ink/ink.d.ts +13 -4
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +119 -25
- package/lib/types/ink/output.d.ts +17 -2
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +85 -2
- package/lib/types/ink/parse-keypress.d.ts +1 -0
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +5 -4
- package/lib/types/ink/render-node-to-output.d.ts +2 -0
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +79 -10
- package/lib/types/ink/root.d.ts +8 -0
- package/lib/types/ink/root.d.ts.map +1 -1
- package/lib/types/ink/root.js +12 -3
- package/lib/types/ink/screen.d.ts +11 -0
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +44 -0
- package/lib/types/ink/selection.d.ts +7 -2
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +187 -44
- package/lib/types/ink/shutdown-input.d.ts +15 -0
- package/lib/types/ink/shutdown-input.d.ts.map +1 -0
- package/lib/types/ink/shutdown-input.js +28 -0
- package/lib/types/ink/sixel-cursor-heal.d.ts +21 -0
- package/lib/types/ink/sixel-cursor-heal.d.ts.map +1 -0
- package/lib/types/ink/sixel-cursor-heal.js +62 -0
- package/lib/types/ink/sixel-graphics.d.ts +6 -0
- package/lib/types/ink/sixel-graphics.d.ts.map +1 -1
- package/lib/types/ink/sixel-graphics.js +18 -0
- package/lib/types/ink/styles.d.ts +8 -1
- package/lib/types/ink/styles.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification-windows.d.ts +195 -0
- package/lib/types/ink/terminal-notification-windows.d.ts.map +1 -0
- package/lib/types/ink/terminal-notification-windows.js +433 -0
- package/lib/types/ink/terminal-notification.d.ts +3 -1
- package/lib/types/ink/terminal-notification.d.ts.map +1 -1
- package/lib/types/ink/terminal-notification.js +4 -1
- package/lib/types/ink/terminal-querier.d.ts +9 -1
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +32 -1
- package/lib/types/ink/terminal.d.ts +23 -2
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +32 -2
- package/lib/types/ink/termio/osc.d.ts +2 -1
- package/lib/types/ink/termio/osc.d.ts.map +1 -1
- package/lib/types/ink/termio/osc.js +37 -8
- package/lib/types/ink/termio/osc7501.d.ts +102 -0
- package/lib/types/ink/termio/osc7501.d.ts.map +1 -0
- package/lib/types/ink/termio/osc7501.js +229 -0
- package/lib/types/ink/termio/tokenize.js +5 -7
- package/lib/types/panels.d.ts +1 -1
- package/lib/types/panels.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.d.ts +3 -1
- package/lib/types/screens/AgentTranscriptScene.d.ts.map +1 -1
- package/lib/types/screens/AgentTranscriptScene.js +5 -1
- package/lib/types/screens/Chat.d.ts +6 -6
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +304 -111
- package/lib/types/screens/Launchpad.d.ts +8 -2
- package/lib/types/screens/Launchpad.d.ts.map +1 -1
- package/lib/types/screens/Launchpad.js +32 -12
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +31 -21
- package/lib/types/screens/Settings.d.ts +5 -1
- package/lib/types/screens/Settings.d.ts.map +1 -1
- package/lib/types/screens/Settings.js +528 -51
- package/lib/types/screens/StatusLine.d.ts +9 -3
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +91 -15
- package/lib/types/screens/StatusMetrics.d.ts +2 -11
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +20 -14
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/ForeignSessionPanes.js +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +13 -21
- package/lib/types/sessionMounts.d.ts +14 -0
- package/lib/types/sessionMounts.d.ts.map +1 -1
- package/lib/types/sessionMounts.js +20 -9
- package/lib/types/sessions/format.d.ts +39 -0
- package/lib/types/sessions/format.d.ts.map +1 -1
- package/lib/types/sessions/format.js +83 -0
- package/lib/types/sessions/resumeFailure.d.ts +4 -0
- package/lib/types/sessions/resumeFailure.d.ts.map +1 -1
- package/lib/types/sessions/resumeFailure.js +12 -4
- package/lib/types/sessions/workspaceCounts.d.ts +6 -0
- package/lib/types/sessions/workspaceCounts.d.ts.map +1 -0
- package/lib/types/sessions/workspaceCounts.js +24 -0
- package/lib/types/settings/definitions.d.ts +24 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +38 -13
- package/lib/types/tips.js +2 -2
- package/lib/types/tuiDisplayPrefs.d.ts +113 -5
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +276 -14
- package/lib/types/update.d.ts +46 -36
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +248 -157
- package/lib/types/updateProcess.d.ts +28 -0
- package/lib/types/updateProcess.d.ts.map +1 -0
- package/lib/types/updateProcess.js +135 -0
- package/lib/types/utils/inputWordBoundary.d.ts +5 -0
- package/lib/types/utils/inputWordBoundary.d.ts.map +1 -0
- package/lib/types/utils/inputWordBoundary.js +18 -0
- package/lib/types/utils/keymap.d.ts +1 -1
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +6 -1
- package/lib/types/windowsInstaller.d.ts +4 -0
- package/lib/types/windowsInstaller.d.ts.map +1 -0
- package/lib/types/windowsInstaller.js +237 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +127 -111
- package/presets/liangshen/custom-bash.mjs +13 -1
- package/presets/liangshen/instruction-hint.mjs +4 -1
- package/presets/liangshen/skill-search.mjs +14 -2
- package/presets/winbash.mjs +16 -4
- package/tui-profile/feed/README.md +17 -8
- package/tui-profile/feed/first-party.json +1 -1
|
@@ -74,6 +74,17 @@ export function startSelection(s, col, row, screen) {
|
|
|
74
74
|
else {
|
|
75
75
|
s.fence = undefined;
|
|
76
76
|
}
|
|
77
|
+
s.paneId = undefined;
|
|
78
|
+
let paneWidth = Infinity;
|
|
79
|
+
for (const [id, rows] of screen?.selectionPanes ?? []) {
|
|
80
|
+
const span = rows.get(row);
|
|
81
|
+
if (!span || col < span.start || col >= span.end || span.end - span.start >= paneWidth || span.excluded?.some(range => col >= range.start && col < range.end))
|
|
82
|
+
continue;
|
|
83
|
+
paneWidth = span.end - span.start;
|
|
84
|
+
s.paneId = id;
|
|
85
|
+
s.fence = { colStart: span.start, colEnd: span.end - 1 };
|
|
86
|
+
s.includeNoSelectCells = false;
|
|
87
|
+
}
|
|
77
88
|
// Focus is not set until the first drag motion. A click-release with no
|
|
78
89
|
// drag leaves focus null → hasSelection/selectionBounds return false/null
|
|
79
90
|
// via the `!s.focus` check, so a bare click never highlights a cell.
|
|
@@ -164,6 +175,7 @@ export function clearSelection(s) {
|
|
|
164
175
|
s.stale = false;
|
|
165
176
|
s.includeNoSelectCells = false;
|
|
166
177
|
s.fence = undefined;
|
|
178
|
+
s.paneId = undefined;
|
|
167
179
|
}
|
|
168
180
|
// Unicode-aware word character matcher: letters (any script), digits,
|
|
169
181
|
// and the punctuation set iTerm2 treats as word-part by default.
|
|
@@ -277,11 +289,11 @@ function comparePoints(a, b) {
|
|
|
277
289
|
* @param row - click row.
|
|
278
290
|
*/
|
|
279
291
|
export function selectWordAt(s, screen, col, row) {
|
|
280
|
-
const b = wordBoundsAt(screen, col, row, s.includeNoSelectCells);
|
|
292
|
+
const b = wordBoundsAt(screen, clamp(col, s.fence?.colStart ?? 0, s.fence?.colEnd ?? screen.width - 1), row, s.includeNoSelectCells);
|
|
281
293
|
if (!b)
|
|
282
294
|
return;
|
|
283
|
-
const lo = { col: b.lo, row };
|
|
284
|
-
const hi = { col: b.hi, row };
|
|
295
|
+
const lo = { col: Math.max(b.lo, s.fence?.colStart ?? 0), row };
|
|
296
|
+
const hi = { col: Math.min(b.hi, s.fence?.colEnd ?? screen.width - 1), row };
|
|
285
297
|
s.anchor = lo;
|
|
286
298
|
s.focus = hi;
|
|
287
299
|
s.isDragging = true;
|
|
@@ -413,8 +425,8 @@ export function findPlainTextUrlAt(screen, col, row) {
|
|
|
413
425
|
export function selectLineAt(s, screen, row) {
|
|
414
426
|
if (row < 0 || row >= screen.height)
|
|
415
427
|
return;
|
|
416
|
-
const lo = { col: 0, row };
|
|
417
|
-
const hi = { col: screen.width - 1, row };
|
|
428
|
+
const lo = { col: s.fence?.colStart ?? 0, row };
|
|
429
|
+
const hi = { col: s.fence?.colEnd ?? screen.width - 1, row };
|
|
418
430
|
s.anchor = lo;
|
|
419
431
|
s.focus = hi;
|
|
420
432
|
s.isDragging = true;
|
|
@@ -439,14 +451,14 @@ export function extendSelection(s, screen, col, row) {
|
|
|
439
451
|
let mLo;
|
|
440
452
|
let mHi;
|
|
441
453
|
if (span.kind === 'word') {
|
|
442
|
-
const b = wordBoundsAt(screen, col, row, s.includeNoSelectCells);
|
|
443
|
-
mLo = { col: b ? b.lo : col, row };
|
|
444
|
-
mHi = { col: b ? b.hi : col, row };
|
|
454
|
+
const b = wordBoundsAt(screen, clamp(col, s.fence?.colStart ?? 0, s.fence?.colEnd ?? screen.width - 1), row, s.includeNoSelectCells);
|
|
455
|
+
mLo = { col: Math.max(b ? b.lo : col, s.fence?.colStart ?? 0), row };
|
|
456
|
+
mHi = { col: Math.min(b ? b.hi : col, s.fence?.colEnd ?? screen.width - 1), row };
|
|
445
457
|
}
|
|
446
458
|
else {
|
|
447
459
|
const r = clamp(row, 0, screen.height - 1);
|
|
448
|
-
mLo = { col: 0, row: r };
|
|
449
|
-
mHi = { col: screen.width - 1, row: r };
|
|
460
|
+
mLo = { col: s.fence?.colStart ?? 0, row: r };
|
|
461
|
+
mHi = { col: s.fence?.colEnd ?? screen.width - 1, row: r };
|
|
450
462
|
}
|
|
451
463
|
if (comparePoints(mHi, span.lo) < 0) {
|
|
452
464
|
// Mouse target ends before anchor span: extend backward.
|
|
@@ -907,12 +919,14 @@ export function shiftSelectionForViewportResize(s, screen, oldTop, oldBottom, ne
|
|
|
907
919
|
* selection is active.
|
|
908
920
|
* @returns the event the selection should be translated by, or null.
|
|
909
921
|
*/
|
|
910
|
-
export function pickFollowForSelection(events, anchorRow) {
|
|
922
|
+
export function pickFollowForSelection(events, anchorRow, anchorCol) {
|
|
911
923
|
if (anchorRow === null)
|
|
912
924
|
return null;
|
|
913
925
|
let best = null;
|
|
914
926
|
let bestHeight = Infinity;
|
|
915
927
|
for (const e of events) {
|
|
928
|
+
if (anchorCol !== undefined && (anchorCol < (e.viewportLeft ?? 0) || anchorCol > (e.viewportRight ?? Infinity)))
|
|
929
|
+
continue;
|
|
916
930
|
if (anchorRow < e.viewportTop || anchorRow > e.viewportBottom)
|
|
917
931
|
continue;
|
|
918
932
|
const height = e.viewportBottom - e.viewportTop;
|
|
@@ -948,9 +962,9 @@ export function selectionBounds(s) {
|
|
|
948
962
|
// side panel selects only panel columns, never the chat column that
|
|
949
963
|
// shares the intermediate rows.
|
|
950
964
|
if (s.fence !== undefined) {
|
|
951
|
-
const colStart =
|
|
952
|
-
const colEnd =
|
|
953
|
-
if (colStart > colEnd)
|
|
965
|
+
const colStart = clamp(start.col, s.fence.colStart, s.fence.colEnd);
|
|
966
|
+
const colEnd = clamp(end.col, s.fence.colStart, s.fence.colEnd);
|
|
967
|
+
if (start.row === end.row && colStart > colEnd)
|
|
954
968
|
return null;
|
|
955
969
|
return { start: { col: colStart, row: start.row }, end: { col: colEnd, row: end.row } };
|
|
956
970
|
}
|
|
@@ -969,6 +983,8 @@ export function isCellSelected(s, col, row) {
|
|
|
969
983
|
if (!b)
|
|
970
984
|
return false;
|
|
971
985
|
const { start, end } = b;
|
|
986
|
+
if (s.fence && (col < s.fence.colStart || col > s.fence.colEnd))
|
|
987
|
+
return false;
|
|
972
988
|
if (row < start.row || row > end.row)
|
|
973
989
|
return false;
|
|
974
990
|
if (row === start.row && col < start.col)
|
|
@@ -977,22 +993,121 @@ export function isCellSelected(s, col, row) {
|
|
|
977
993
|
return false;
|
|
978
994
|
return true;
|
|
979
995
|
}
|
|
996
|
+
function paneSpan(s, screen, row) {
|
|
997
|
+
return s.paneId === undefined ? undefined : screen.selectionPanes?.get(s.paneId)?.get(row);
|
|
998
|
+
}
|
|
999
|
+
function paneCellVisible(s, screen, row, col) {
|
|
1000
|
+
return !paneSpan(s, screen, row)?.excluded?.some(range => col >= range.start && col < range.end);
|
|
1001
|
+
}
|
|
1002
|
+
function selectedWrap(s, screen, row) {
|
|
1003
|
+
return s.paneId === undefined ? screen.softWrap[row] ?? 0 : paneSpan(s, screen, row)?.wrap ?? 0;
|
|
1004
|
+
}
|
|
1005
|
+
/** Map logical text offsets back to cells when a pane reflows horizontally.
|
|
1006
|
+
* Uses the same noSelect, wrap and grapheme rules as the copy path. Semantic
|
|
1007
|
+
* image regions cannot be mapped to character cells and keep the stale guard.
|
|
1008
|
+
*/
|
|
1009
|
+
function paneTextMap(s, screen) {
|
|
1010
|
+
const spans = screen.selectionPanes?.get(s.paneId);
|
|
1011
|
+
if (!spans)
|
|
1012
|
+
return;
|
|
1013
|
+
let text = '';
|
|
1014
|
+
const points = [];
|
|
1015
|
+
for (const [row, span] of [...spans].sort(([a], [b]) => a - b)) {
|
|
1016
|
+
if (screen.noSelect.subarray(row * screen.width + span.start, row * screen.width + span.end).every(bit => bit === 1))
|
|
1017
|
+
continue;
|
|
1018
|
+
const data = extractRowText(screen, row, span.start, span.end - 1, true, false, s);
|
|
1019
|
+
if (data.regions.length > 0)
|
|
1020
|
+
return;
|
|
1021
|
+
if (text.length > 0 && !data.sw) {
|
|
1022
|
+
text += '\n';
|
|
1023
|
+
points.push({ col: span.start, row });
|
|
1024
|
+
}
|
|
1025
|
+
const rowPoints = [];
|
|
1026
|
+
for (let col = span.start; col < span.end; col++) {
|
|
1027
|
+
if (screen.noSelect[row * screen.width + col] === 1 || !paneCellVisible(s, screen, row, col))
|
|
1028
|
+
continue;
|
|
1029
|
+
const cell = cellAt(screen, col, row);
|
|
1030
|
+
if (!cell || cell.width === 2 /* CellWidth.SpacerTail */ || cell.width === 3 /* CellWidth.SpacerHead */)
|
|
1031
|
+
continue;
|
|
1032
|
+
for (let i = 0; i < cell.char.length; i++)
|
|
1033
|
+
rowPoints.push({ col, row });
|
|
1034
|
+
}
|
|
1035
|
+
text += data.text;
|
|
1036
|
+
for (let i = 0; i < data.text.length; i++)
|
|
1037
|
+
points.push(rowPoints[i] ?? { col: span.end - 1, row });
|
|
1038
|
+
}
|
|
1039
|
+
return { text: text.trimEnd(), points: points.slice(0, text.trimEnd().length) };
|
|
1040
|
+
}
|
|
1041
|
+
/** Re-anchor by logical offsets, not screen columns, when a pane reflows. */
|
|
1042
|
+
export function refreshSelectionPane(s, screen, previous) {
|
|
1043
|
+
if (s.paneId === undefined || s.anchor === null)
|
|
1044
|
+
return false;
|
|
1045
|
+
const span = paneSpan(s, screen, s.anchor.row)
|
|
1046
|
+
?? screen.selectionPanes?.get(s.paneId)?.values().next().value;
|
|
1047
|
+
if (!span) {
|
|
1048
|
+
clearSelection(s);
|
|
1049
|
+
return true;
|
|
1050
|
+
}
|
|
1051
|
+
// A captured anchor no longer denotes the row clamped to the viewport edge.
|
|
1052
|
+
// Its replacement may have a different span within the same diff pane;
|
|
1053
|
+
// a viewport pane still provides its column geometry after the anchor leaves.
|
|
1054
|
+
if (s.virtualAnchorRow !== undefined && !span.viewport)
|
|
1055
|
+
return false;
|
|
1056
|
+
const old = s.fence;
|
|
1057
|
+
const delta = span.start - (old?.colStart ?? span.start);
|
|
1058
|
+
const changed = delta !== 0 || old?.colEnd !== span.end - 1;
|
|
1059
|
+
if (changed && s.focus && previous) {
|
|
1060
|
+
const bounds = selectionBounds(s);
|
|
1061
|
+
const before = paneTextMap(s, previous);
|
|
1062
|
+
const after = paneTextMap(s, screen);
|
|
1063
|
+
if (before && after && before.text === after.text) {
|
|
1064
|
+
const first = before.points.findIndex(point => comparePoints(point, bounds.start) >= 0);
|
|
1065
|
+
let last = before.points.length - 1;
|
|
1066
|
+
while (last >= 0 && comparePoints(before.points[last], bounds.end) > 0)
|
|
1067
|
+
last--;
|
|
1068
|
+
if (first >= 0 && last >= first && after.points[first] && after.points[last]) {
|
|
1069
|
+
const reverse = comparePoints(s.anchor, s.focus) > 0;
|
|
1070
|
+
s.anchor = { ...after.points[reverse ? last : first] };
|
|
1071
|
+
s.focus = { ...after.points[reverse ? first : last] };
|
|
1072
|
+
// A completed word/line selection no longer needs the old screen span.
|
|
1073
|
+
s.anchorSpan = null;
|
|
1074
|
+
}
|
|
1075
|
+
else
|
|
1076
|
+
s.stale = true;
|
|
1077
|
+
}
|
|
1078
|
+
else {
|
|
1079
|
+
// A resize that also replaces/clips content is not evidence that the
|
|
1080
|
+
// old selection still denotes it. Never bless changed clipboard bytes.
|
|
1081
|
+
s.stale = true;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
else if (changed) {
|
|
1085
|
+
for (const point of new Set([s.anchor, s.focus, s.anchorSpan?.lo, s.anchorSpan?.hi])) {
|
|
1086
|
+
if (point)
|
|
1087
|
+
point.col = clamp(point.col + delta, span.start, span.end - 1);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
s.fence = { colStart: span.start, colEnd: span.end - 1 };
|
|
1091
|
+
return changed;
|
|
1092
|
+
}
|
|
980
1093
|
/** Extract text from one screen row, plus the copy regions it touches.
|
|
981
1094
|
* When the next row is a soft-wrap continuation (screen.softWrap[row+1]!==0),
|
|
982
1095
|
* clamp to that content-end column and skip the trailing trim so the
|
|
983
1096
|
* word-separator space survives the join. See Screen.softWrap for why the
|
|
984
1097
|
* clamp is necessary. */
|
|
985
|
-
function extractRowText(screen, row, colStart, colEnd, continuesSelection, includeNoSelect = false) {
|
|
1098
|
+
function extractRowText(screen, row, colStart, colEnd, continuesSelection, includeNoSelect = false, selection) {
|
|
986
1099
|
const noSelect = screen.noSelect;
|
|
987
1100
|
const copyRegion = screen.copyRegion;
|
|
988
1101
|
const rowOff = row * screen.width;
|
|
989
|
-
const next = row + 1 < screen.height ? screen.softWrap[row + 1] : 0;
|
|
1102
|
+
const next = row + 1 < screen.height ? (selection ? selectedWrap(selection, screen, row + 1) : screen.softWrap[row + 1]) : 0;
|
|
990
1103
|
const contentEnd = Math.abs(next);
|
|
991
1104
|
const lastCol = contentEnd > 0 ? Math.min(colEnd, contentEnd - 1) : colEnd;
|
|
992
1105
|
let line = '';
|
|
993
1106
|
const regions = [];
|
|
994
1107
|
let lastRegion = 0;
|
|
995
1108
|
for (let col = colStart; col <= lastCol; col++) {
|
|
1109
|
+
if (selection && !paneCellVisible(selection, screen, row, col))
|
|
1110
|
+
continue;
|
|
996
1111
|
// Skip cells marked noSelect (gutters, line numbers, diff sigils) unless
|
|
997
1112
|
// this gesture anchored inside a noSelect region (the direction fence:
|
|
998
1113
|
// a panel-origin drag selects panel text). Check before cellAt to avoid
|
|
@@ -1032,7 +1147,7 @@ function extractRowText(screen, row, colStart, colEnd, continuesSelection, inclu
|
|
|
1032
1147
|
const tail = regions.length > 0 ? regions[regions.length - 1].at : 0;
|
|
1033
1148
|
return {
|
|
1034
1149
|
text: contentEnd > 0 ? line : line.slice(0, tail) + line.slice(tail).replace(/\s+$/, ''),
|
|
1035
|
-
sw: screen.softWrap[row] !== 0,
|
|
1150
|
+
sw: (selection ? selectedWrap(selection, screen, row) : screen.softWrap[row]) !== 0,
|
|
1036
1151
|
regions,
|
|
1037
1152
|
};
|
|
1038
1153
|
}
|
|
@@ -1149,8 +1264,6 @@ function joinRows(lines, text, sw) {
|
|
|
1149
1264
|
* @returns true when an uncoordinated change latched `stale` this call.
|
|
1150
1265
|
*/
|
|
1151
1266
|
export function refreshSelectionFingerprint(s, screen, coordinated) {
|
|
1152
|
-
if (s.stale)
|
|
1153
|
-
return false;
|
|
1154
1267
|
const b = selectionBounds(s);
|
|
1155
1268
|
if (!b) {
|
|
1156
1269
|
s.coveredFingerprint = null;
|
|
@@ -1164,10 +1277,24 @@ export function refreshSelectionFingerprint(s, screen, coordinated) {
|
|
|
1164
1277
|
// stationary highlight can go stale.
|
|
1165
1278
|
const geometry = `${b.start.row}:${b.start.col}-${b.end.row}:${b.end.col}`;
|
|
1166
1279
|
if (geometry !== s.coveredGeometry) {
|
|
1280
|
+
// Passive follow/resize must record its geometry without unlocking a
|
|
1281
|
+
// stale selection on this frame or the next stationary frame.
|
|
1282
|
+
if (!coordinated)
|
|
1283
|
+
s.stale = false;
|
|
1167
1284
|
s.coveredGeometry = geometry;
|
|
1168
1285
|
s.coveredFingerprint = null;
|
|
1169
1286
|
s.coveredText = null;
|
|
1170
1287
|
}
|
|
1288
|
+
if (s.stale)
|
|
1289
|
+
return false;
|
|
1290
|
+
if (s.paneId !== undefined) {
|
|
1291
|
+
const text = getSelectedText(s, screen);
|
|
1292
|
+
const changed = s.coveredText !== null && s.coveredText !== text && !coordinated;
|
|
1293
|
+
s.coveredText = text;
|
|
1294
|
+
if (changed)
|
|
1295
|
+
s.stale = true;
|
|
1296
|
+
return changed;
|
|
1297
|
+
}
|
|
1171
1298
|
const { cells, noSelect, width, height, charPool, softWrap } = screen;
|
|
1172
1299
|
const copyRegion = screen.copyRegion;
|
|
1173
1300
|
const copyTexts = screen.copyTexts;
|
|
@@ -1317,13 +1444,19 @@ export function getSelectedText(s, screen) {
|
|
|
1317
1444
|
let rowEnd = row === end.row ? end.col : screen.width - 1;
|
|
1318
1445
|
// Fence (panel-origin gestures) applies to EVERY row, not just the
|
|
1319
1446
|
// endpoints: intermediate rows must not span into the chat column.
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1447
|
+
const pane = paneSpan(s, screen, row);
|
|
1448
|
+
if (s.paneId !== undefined && !pane)
|
|
1449
|
+
continue;
|
|
1450
|
+
const fence = pane ? { colStart: pane.start, colEnd: pane.end - 1 } : s.fence;
|
|
1451
|
+
if (fence !== undefined) {
|
|
1452
|
+
rowStart = Math.max(rowStart, fence.colStart);
|
|
1453
|
+
rowEnd = Math.min(rowEnd, fence.colEnd);
|
|
1323
1454
|
if (rowStart > rowEnd)
|
|
1324
1455
|
continue;
|
|
1325
1456
|
}
|
|
1326
|
-
|
|
1457
|
+
if (s.paneId !== undefined && (screen.noSelect.subarray(row * screen.width + rowStart, row * screen.width + rowEnd + 1).every(bit => bit === 1) || pane?.excluded?.some(range => range.start <= rowStart && range.end > rowEnd)))
|
|
1458
|
+
continue;
|
|
1459
|
+
rows.push(extractRowText(screen, row, rowStart, rowEnd, row < end.row || s.scrolledOffBelow.length > 0, s.includeNoSelectCells, s));
|
|
1327
1460
|
}
|
|
1328
1461
|
for (let i = 0; i < s.scrolledOffBelow.length; i++) {
|
|
1329
1462
|
rows.push(s.scrolledOffBelow[i]);
|
|
@@ -1337,7 +1470,7 @@ export function getSelectedText(s, screen) {
|
|
|
1337
1470
|
* drag-to-scroll, BEFORE scrollBy overwrites them. Only the rows that
|
|
1338
1471
|
* intersect the selection are captured, using the selection's col bounds
|
|
1339
1472
|
* for the anchor-side boundary row. After capturing the anchor row, the
|
|
1340
|
-
* anchor.col AND anchorSpan cols are reset to the
|
|
1473
|
+
* anchor.col AND anchorSpan cols are reset to the pane boundary so
|
|
1341
1474
|
* subsequent captures and the final getSelectedText don't re-apply a stale
|
|
1342
1475
|
* col constraint to content that's no longer under the original anchor.
|
|
1343
1476
|
* Both span cols are reset (not just the near side): after a blocked
|
|
@@ -1365,12 +1498,19 @@ export function captureScrolledRows(s, screen, firstRow, lastRow, side, screenRo
|
|
|
1365
1498
|
if (lo > hi)
|
|
1366
1499
|
return;
|
|
1367
1500
|
const width = screen.width;
|
|
1501
|
+
const edgeLo = s.fence?.colStart ?? 0;
|
|
1502
|
+
const edgeHi = s.fence?.colEnd ?? width - 1;
|
|
1368
1503
|
const captured = [];
|
|
1369
1504
|
for (let row = lo; row <= hi; row++) {
|
|
1370
|
-
const colStart = row === start.row ? start.col : 0;
|
|
1371
|
-
const colEnd = row === end.row ? end.col : width - 1;
|
|
1372
1505
|
const screenRow = row - screenRowOffset;
|
|
1373
|
-
|
|
1506
|
+
const pane = paneSpan(s, screen, screenRow);
|
|
1507
|
+
if (s.paneId !== undefined && !pane)
|
|
1508
|
+
continue;
|
|
1509
|
+
const colStart = Math.max(row === start.row ? start.col : 0, pane?.start ?? s.fence?.colStart ?? 0);
|
|
1510
|
+
const colEnd = Math.min(row === end.row ? end.col : width - 1, pane ? pane.end - 1 : s.fence?.colEnd ?? width - 1);
|
|
1511
|
+
if (colStart > colEnd || (s.paneId !== undefined && (screen.noSelect.subarray(screenRow * width + colStart, screenRow * width + colEnd + 1).every(bit => bit === 1) || pane?.excluded?.some(range => range.start <= colStart && range.end > colEnd))))
|
|
1512
|
+
continue;
|
|
1513
|
+
captured.push(extractRowText(screen, screenRow, colStart, colEnd, row < end.row || s.scrolledOffBelow.length > 0, s.includeNoSelectCells, s));
|
|
1374
1514
|
}
|
|
1375
1515
|
if (side === 'above') {
|
|
1376
1516
|
// Newest rows go at the bottom of the above-accumulator (closest to
|
|
@@ -1378,15 +1518,15 @@ export function captureScrolledRows(s, screen, firstRow, lastRow, side, screenRo
|
|
|
1378
1518
|
s.scrolledOffAbove.push(...captured);
|
|
1379
1519
|
// We just captured the top of the selection. The anchor (=start when
|
|
1380
1520
|
// dragging down) is now pointing at content that will scroll out; its
|
|
1381
|
-
// col constraint was applied to the captured row. Reset to
|
|
1521
|
+
// col constraint was applied to the captured row. Reset to the pane edge so
|
|
1382
1522
|
// the NEXT tick and the final getSelectedText read the full row.
|
|
1383
1523
|
if (s.anchor && s.anchor.row === start.row && lo === start.row) {
|
|
1384
|
-
s.anchor = { col:
|
|
1524
|
+
s.anchor = { col: edgeLo, row: s.anchor.row };
|
|
1385
1525
|
if (s.anchorSpan) {
|
|
1386
1526
|
s.anchorSpan = {
|
|
1387
1527
|
kind: s.anchorSpan.kind,
|
|
1388
|
-
lo: { col:
|
|
1389
|
-
hi: { col:
|
|
1528
|
+
lo: { col: edgeLo, row: s.anchorSpan.lo.row },
|
|
1529
|
+
hi: { col: edgeHi, row: s.anchorSpan.hi.row },
|
|
1390
1530
|
};
|
|
1391
1531
|
}
|
|
1392
1532
|
}
|
|
@@ -1396,12 +1536,12 @@ export function captureScrolledRows(s, screen, firstRow, lastRow, side, screenRo
|
|
|
1396
1536
|
// closest to the on-screen content.
|
|
1397
1537
|
s.scrolledOffBelow.unshift(...captured);
|
|
1398
1538
|
if (s.anchor && s.anchor.row === end.row && hi === end.row) {
|
|
1399
|
-
s.anchor = { col:
|
|
1539
|
+
s.anchor = { col: edgeHi, row: s.anchor.row };
|
|
1400
1540
|
if (s.anchorSpan) {
|
|
1401
1541
|
s.anchorSpan = {
|
|
1402
1542
|
kind: s.anchorSpan.kind,
|
|
1403
|
-
lo: { col:
|
|
1404
|
-
hi: { col:
|
|
1543
|
+
lo: { col: edgeLo, row: s.anchorSpan.lo.row },
|
|
1544
|
+
hi: { col: edgeHi, row: s.anchorSpan.hi.row },
|
|
1405
1545
|
};
|
|
1406
1546
|
}
|
|
1407
1547
|
}
|
|
@@ -1414,24 +1554,27 @@ function selectedRowColumns(screen, selection, row, start, end) {
|
|
|
1414
1554
|
const width = screen.width;
|
|
1415
1555
|
let colStart = Math.max(0, row === start.row ? start.col : 0);
|
|
1416
1556
|
let colEnd = row === end.row ? Math.min(end.col, width - 1) : width - 1;
|
|
1417
|
-
|
|
1418
|
-
if (selection.
|
|
1419
|
-
|
|
1420
|
-
|
|
1557
|
+
const pane = paneSpan(selection, screen, row);
|
|
1558
|
+
if (selection.paneId !== undefined && !pane)
|
|
1559
|
+
return null;
|
|
1560
|
+
const fence = pane ? { colStart: pane.start, colEnd: pane.end - 1 } : selection.fence;
|
|
1561
|
+
if (fence !== undefined) {
|
|
1562
|
+
colStart = Math.max(colStart, fence.colStart);
|
|
1563
|
+
colEnd = Math.min(colEnd, fence.colEnd);
|
|
1421
1564
|
}
|
|
1422
1565
|
if (colStart > colEnd)
|
|
1423
1566
|
return null;
|
|
1424
1567
|
const rowOff = row * width;
|
|
1425
1568
|
// Ignore excluded columns when finding the last content cell: text in
|
|
1426
1569
|
// the side panel must not extend a chat-origin highlight or cursor.
|
|
1427
|
-
const rowStart =
|
|
1428
|
-
let rowEnd = Math.min(
|
|
1429
|
-
const wrappedEnd = row + 1 < screen.height ? screen
|
|
1570
|
+
const rowStart = fence?.colStart ?? 0;
|
|
1571
|
+
let rowEnd = Math.min(fence?.colEnd ?? width - 1, width - 1);
|
|
1572
|
+
const wrappedEnd = row + 1 < screen.height ? selectedWrap(selection, screen, row + 1) : 0;
|
|
1430
1573
|
if (wrappedEnd > 0)
|
|
1431
1574
|
rowEnd = Math.min(rowEnd, wrappedEnd - 1);
|
|
1432
1575
|
for (let col = rowEnd; col >= rowStart; col--) {
|
|
1433
1576
|
const idx = rowOff + col;
|
|
1434
|
-
if (screen.noSelect[idx] === 1 && !selection.includeNoSelectCells)
|
|
1577
|
+
if (!paneCellVisible(selection, screen, row, col) || (screen.noSelect[idx] === 1 && !selection.includeNoSelectCells))
|
|
1435
1578
|
continue;
|
|
1436
1579
|
const cell = cellAtIndex(screen, idx);
|
|
1437
1580
|
if (cell.width === 2 /* CellWidth.SpacerTail */ || cell.width === 3 /* CellWidth.SpacerHead */)
|
|
@@ -1464,7 +1607,7 @@ export function getSelectionCursor(screen, selection) {
|
|
|
1464
1607
|
continue;
|
|
1465
1608
|
for (let col = forward ? columns.end : columns.start; col >= columns.start && col <= columns.end; col += step) {
|
|
1466
1609
|
const idx = row * screen.width + col;
|
|
1467
|
-
if (screen.noSelect[idx] === 1 && !selection.includeNoSelectCells)
|
|
1610
|
+
if (!paneCellVisible(selection, screen, row, col) || (screen.noSelect[idx] === 1 && !selection.includeNoSelectCells))
|
|
1468
1611
|
continue;
|
|
1469
1612
|
const cell = cellAtIndex(screen, idx);
|
|
1470
1613
|
if (cell.width === 2 /* CellWidth.SpacerTail */ || cell.width === 3 /* CellWidth.SpacerHead */)
|
|
@@ -1513,7 +1656,7 @@ export function applySelectionOverlay(screen, selection, stylePool, images = [])
|
|
|
1513
1656
|
// still highlight so the selection extent remains visible. A gesture
|
|
1514
1657
|
// that ANCHORED on a noSelect cell (the direction fence) inverts this:
|
|
1515
1658
|
// those cells are the selection's subject, so they must highlight.
|
|
1516
|
-
if (noSelect[idx] === 1 && !selection.includeNoSelectCells)
|
|
1659
|
+
if (!paneCellVisible(selection, screen, row, col) || (noSelect[idx] === 1 && !selection.includeNoSelectCells))
|
|
1517
1660
|
continue;
|
|
1518
1661
|
// Skip cells a terminal image is painted over: Kitty draws images
|
|
1519
1662
|
// below cells with a non-default background, so a highlighted cell
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** A renderer-owned input lease retained until terminal cleanup has settled. */
|
|
2
|
+
export type ShutdownInput = {
|
|
3
|
+
readonly stdout: NodeJS.WriteStream;
|
|
4
|
+
ownsInput: () => boolean;
|
|
5
|
+
drain: () => void;
|
|
6
|
+
release: () => void;
|
|
7
|
+
};
|
|
8
|
+
/** Share TTY input exclusively; input-free roots are independent per output. */
|
|
9
|
+
export declare function claimShutdownInput(stdin: NodeJS.ReadStream, stdout: NodeJS.WriteStream, drain: () => void, revoke?: () => void): ShutdownInput;
|
|
10
|
+
/** Preserve the lease even when a legacy wrapper retains only unmount(). */
|
|
11
|
+
export declare function registerShutdownInput(unmount: () => void, input: ShutdownInput): void;
|
|
12
|
+
export declare function getShutdownInput(handle: {
|
|
13
|
+
unmount: () => void;
|
|
14
|
+
} | undefined): ShutdownInput | undefined;
|
|
15
|
+
//# sourceMappingURL=shutdown-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shutdown-input.d.ts","sourceRoot":"","sources":["../../../src/ink/shutdown-input.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAA;IACnC,SAAS,EAAE,MAAM,OAAO,CAAA;IACxB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAAA;AAKD,gFAAgF;AAChF,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,UAAU,EACxB,MAAM,EAAE,MAAM,CAAC,WAAW,EAC1B,KAAK,EAAE,MAAM,IAAI,EACjB,MAAM,CAAC,EAAE,MAAM,IAAI,GAClB,aAAa,CAef;AAED,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,KAAK,EAAE,aAAa,GAAG,IAAI,CAErF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAEvG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const owners = new WeakMap();
|
|
2
|
+
const handles = new WeakMap();
|
|
3
|
+
/** Share TTY input exclusively; input-free roots are independent per output. */
|
|
4
|
+
export function claimShutdownInput(stdin, stdout, drain, revoke) {
|
|
5
|
+
// Non-TTY stdin has no raw-mode/readable owner; render() roots use stdout identity.
|
|
6
|
+
const key = stdin.isTTY ? stdin : stdout;
|
|
7
|
+
const previous = owners.get(key);
|
|
8
|
+
const token = { revoke };
|
|
9
|
+
owners.set(key, token);
|
|
10
|
+
// Revoke before latching the old renderer so its cleanup cannot touch ours.
|
|
11
|
+
previous?.revoke?.();
|
|
12
|
+
const ownsInput = () => owners.get(key) === token;
|
|
13
|
+
return {
|
|
14
|
+
stdout,
|
|
15
|
+
ownsInput,
|
|
16
|
+
drain: () => { if (ownsInput() && stdin.isTTY && !stdin.destroyed)
|
|
17
|
+
drain(); },
|
|
18
|
+
release: () => { if (owners.get(key) === token)
|
|
19
|
+
owners.delete(key); },
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** Preserve the lease even when a legacy wrapper retains only unmount(). */
|
|
23
|
+
export function registerShutdownInput(unmount, input) {
|
|
24
|
+
handles.set(unmount, input);
|
|
25
|
+
}
|
|
26
|
+
export function getShutdownInput(handle) {
|
|
27
|
+
return handle === undefined ? undefined : handles.get(handle.unmount);
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type TerminalQuerier } from './terminal-querier.js';
|
|
2
|
+
/** One ordered pre-park probe, with bounded recovery and lifecycle cancellation. */
|
|
3
|
+
export declare class SixelCursorHeal {
|
|
4
|
+
private readonly recover;
|
|
5
|
+
private readonly log;
|
|
6
|
+
private readonly now;
|
|
7
|
+
private pending;
|
|
8
|
+
private recoveredAt;
|
|
9
|
+
private quietUntil;
|
|
10
|
+
private disposed;
|
|
11
|
+
constructor(recover: () => void, log: (message: string) => void, now?: () => number);
|
|
12
|
+
/** Returns bytes to append immediately after the last sixel payload, before CUP. */
|
|
13
|
+
prepare(querier: TerminalQuerier, expected: {
|
|
14
|
+
row: number;
|
|
15
|
+
col: number;
|
|
16
|
+
}): string;
|
|
17
|
+
/** Resize/handoff invalidates geometry and quarantines already travelling replies. */
|
|
18
|
+
reset(): void;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=sixel-cursor-heal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sixel-cursor-heal.d.ts","sourceRoot":"","sources":["../../../src/ink/sixel-cursor-heal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAM5E,oFAAoF;AACpF,qBAAa,eAAe;IAOxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,GAAG;IARtB,OAAO,CAAC,OAAO,CAAoC;IACnD,OAAO,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,UAAU,CAAI;IACtB,OAAO,CAAC,QAAQ,CAAQ;gBAGL,OAAO,EAAE,MAAM,IAAI,EACnB,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EAC9B,GAAG,GAAE,MAAM,MAAiB;IAG/C,oFAAoF;IACpF,OAAO,CAAC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IA0BjF,sFAAsF;IACtF,KAAK,IAAI,IAAI;IAOb,OAAO,IAAI,IAAI;CAKhB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { cursorPosition } from './terminal-querier.js';
|
|
2
|
+
const REPLY_TIMEOUT_MS = 500;
|
|
3
|
+
const RECOVERY_WINDOW_MS = 10_000;
|
|
4
|
+
const COOLDOWN_MS = 60_000;
|
|
5
|
+
/** One ordered pre-park probe, with bounded recovery and lifecycle cancellation. */
|
|
6
|
+
export class SixelCursorHeal {
|
|
7
|
+
recover;
|
|
8
|
+
log;
|
|
9
|
+
now;
|
|
10
|
+
pending;
|
|
11
|
+
recoveredAt = [];
|
|
12
|
+
quietUntil = 0;
|
|
13
|
+
disposed = false;
|
|
14
|
+
constructor(recover, log, now = Date.now) {
|
|
15
|
+
this.recover = recover;
|
|
16
|
+
this.log = log;
|
|
17
|
+
this.now = now;
|
|
18
|
+
}
|
|
19
|
+
/** Returns bytes to append immediately after the last sixel payload, before CUP. */
|
|
20
|
+
prepare(querier, expected) {
|
|
21
|
+
if (this.disposed || this.pending !== undefined || this.now() < this.quietUntil || querier.isSuspended)
|
|
22
|
+
return '';
|
|
23
|
+
const query = querier.prepare(cursorPosition(), REPLY_TIMEOUT_MS);
|
|
24
|
+
if (query.request === '')
|
|
25
|
+
return '';
|
|
26
|
+
this.pending = query;
|
|
27
|
+
void query.response.then(reply => {
|
|
28
|
+
if (this.pending !== query || this.disposed)
|
|
29
|
+
return;
|
|
30
|
+
this.pending = undefined;
|
|
31
|
+
if (reply === undefined) {
|
|
32
|
+
// Private CPR has no request id. Avoid attributing a very late reply
|
|
33
|
+
// to the next frame after a timeout or a DA1 barrier rejected it.
|
|
34
|
+
this.quietUntil = this.now() + COOLDOWN_MS;
|
|
35
|
+
this.log('sixel cursor probe unanswered; pausing probes for 60s');
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (reply.row === expected.row && reply.col === expected.col)
|
|
39
|
+
return;
|
|
40
|
+
const now = this.now();
|
|
41
|
+
this.recoveredAt = this.recoveredAt.filter(time => now - time < RECOVERY_WINDOW_MS);
|
|
42
|
+
this.recoveredAt.push(now);
|
|
43
|
+
if (this.recoveredAt.length >= 3)
|
|
44
|
+
this.quietUntil = now + COOLDOWN_MS;
|
|
45
|
+
this.log(`sixel cursor drift expected=${expected.row},${expected.col} actual=${reply.row},${reply.col}; recovery ${this.recoveredAt.length}/3`);
|
|
46
|
+
this.recover();
|
|
47
|
+
});
|
|
48
|
+
return query.request;
|
|
49
|
+
}
|
|
50
|
+
/** Resize/handoff invalidates geometry and quarantines already travelling replies. */
|
|
51
|
+
reset() {
|
|
52
|
+
const pending = this.pending;
|
|
53
|
+
this.pending = undefined;
|
|
54
|
+
pending?.cancel();
|
|
55
|
+
this.quietUntil = Math.max(this.quietUntil, this.now() + REPLY_TIMEOUT_MS);
|
|
56
|
+
}
|
|
57
|
+
dispose() {
|
|
58
|
+
this.disposed = true;
|
|
59
|
+
this.reset();
|
|
60
|
+
this.recoveredAt = [];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -30,6 +30,12 @@ export declare class SixelGraphicsManager {
|
|
|
30
30
|
private columns;
|
|
31
31
|
private rows;
|
|
32
32
|
private displayModeSet;
|
|
33
|
+
private readonly cursorOffsets;
|
|
34
|
+
/** WT leaves the cursor at the last sixel band's row and the initial column. */
|
|
35
|
+
cursorAfterPaint: {
|
|
36
|
+
row: number;
|
|
37
|
+
col: number;
|
|
38
|
+
} | undefined;
|
|
33
39
|
constructor(onReady: () => void, encoder?: Encoder | undefined);
|
|
34
40
|
get hasImage(): boolean;
|
|
35
41
|
setDisplayMode(enabled: boolean): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sixel-graphics.d.ts","sourceRoot":"","sources":["../../../src/ink/sixel-graphics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAA2C,MAAM,kBAAkB,CAAA;AAChH,OAAO,EAIL,KAAK,gBAAgB,EAAE,KAAK,sBAAsB,EACnD,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAwBtC,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;AAiBpE,oFAAoF;AACpF,qBAAa,oBAAoB;
|
|
1
|
+
{"version":3,"file":"sixel-graphics.d.ts","sourceRoot":"","sources":["../../../src/ink/sixel-graphics.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAA2C,MAAM,kBAAkB,CAAA;AAChH,OAAO,EAIL,KAAK,gBAAgB,EAAE,KAAK,sBAAsB,EACnD,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAuB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAwBtC,KAAK,OAAO,GAAG,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;AAiBpE,oFAAoF;AACpF,qBAAa,oBAAoB;IA4BnB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAAc,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IA3B3E,OAAO,CAAC,IAAI,CAA+C;IAC3D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAoC;IACxD,OAAO,CAAC,MAAM,CAAI;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwC;IAC9D,OAAO,CAAC,WAAW,CAAI;IACvB,OAAO,CAAC,UAAU,CAAI;IACtB,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiC;IACvD,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,SAAS,CAAmC;IACpD,OAAO,CAAC,WAAW,CAAmC;IACtD,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmC;IACxD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,YAAY,CAAuC;IAC3D,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,OAAO,CAAI;IACnB,OAAO,CAAC,IAAI,CAAI;IAChB,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqC;IACnE,gFAAgF;IAChF,gBAAgB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAA;gBAE7B,OAAO,EAAE,MAAM,IAAI,EAAmB,OAAO,CAAC,EAAE,OAAO,YAAA;IAEpF,IAAI,QAAQ,IAAI,OAAO,CAAgE;IAEvF,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAKtC,WAAW,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO;IAQ5C,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAO/C,QAAQ,CAAC,OAAO,GAAI,WAAW,sBAAsB,KAAG,OAAO,CAc9D;IAED,OAAO,CAAC,OAAO;IAkDf;;;;;;;;;;;;;;;;OAgBG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,SAAS,sBAAsB,EAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE;IAwGhI,iFAAiF;IACjF,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;IAgCzB,aAAa,IAAI,IAAI;IAErB,KAAK,IAAI,MAAM;IAWf,OAAO,IAAI,MAAM;IAajB,OAAO,CAAC,KAAK;IAiBb,OAAO,CAAC,WAAW;IAcnB,OAAO,CAAC,UAAU;IAwBlB,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,cAAc;CAkEvB"}
|
|
@@ -44,6 +44,9 @@ export class SixelGraphicsManager {
|
|
|
44
44
|
columns = 0;
|
|
45
45
|
rows = 0;
|
|
46
46
|
displayModeSet = false;
|
|
47
|
+
cursorOffsets = new WeakMap();
|
|
48
|
+
/** WT leaves the cursor at the last sixel band's row and the initial column. */
|
|
49
|
+
cursorAfterPaint;
|
|
47
50
|
constructor(onReady, encoder) {
|
|
48
51
|
this.onReady = onReady;
|
|
49
52
|
this.encoder = encoder;
|
|
@@ -265,6 +268,7 @@ export class SixelGraphicsManager {
|
|
|
265
268
|
}
|
|
266
269
|
/** Unchanged images have zero transport cost, including unrelated text ticks. */
|
|
267
270
|
paint(diff) {
|
|
271
|
+
this.cursorAfterPaint = undefined;
|
|
268
272
|
let damage;
|
|
269
273
|
let draw = '';
|
|
270
274
|
for (const [node, next] of this.nextDisplay) {
|
|
@@ -275,6 +279,20 @@ export class SixelGraphicsManager {
|
|
|
275
279
|
continue;
|
|
276
280
|
}
|
|
277
281
|
draw += `\x1b[${next.y + 1};${next.x + 1}H${next.raster.data}`;
|
|
282
|
+
// WT SixelParser::_updateTextCursor preserves X and uses the final band
|
|
283
|
+
// (microsoft/terminal src/terminal/adapter/SixelParser.cpp).
|
|
284
|
+
// Derive the final band from the actual encoded control path, not a CPR
|
|
285
|
+
// sample or raster height (a trailing '-' advances another sixel band).
|
|
286
|
+
let offset = this.cursorOffsets.get(next.raster);
|
|
287
|
+
if (offset === undefined) {
|
|
288
|
+
offset = 0;
|
|
289
|
+
for (const byte of next.raster.data)
|
|
290
|
+
if (byte === '-')
|
|
291
|
+
offset += 6;
|
|
292
|
+
this.cursorOffsets.set(next.raster, offset);
|
|
293
|
+
}
|
|
294
|
+
const row = next.y + Math.floor(offset / this.cell.height) + 1;
|
|
295
|
+
this.cursorAfterPaint = row <= this.rows ? { row, col: next.x + 1 } : undefined;
|
|
278
296
|
}
|
|
279
297
|
this.displayed = new Map(this.nextDisplay);
|
|
280
298
|
// Rects held this frame stay on screen: they were neither erased nor
|
|
@@ -332,6 +332,10 @@ export type Styles = {
|
|
|
332
332
|
* doesn't pick up leading whitespace from middle rows.
|
|
333
333
|
*/
|
|
334
334
|
readonly noSelect?: boolean | 'from-left-edge';
|
|
335
|
+
/** Stable copy ownership for a pane; metadata is one span per visible row. */
|
|
336
|
+
readonly selectionPane?: string;
|
|
337
|
+
/** A pane wrapping scroll viewports keeps its geometry while contents move. */
|
|
338
|
+
readonly selectionPaneViewport?: boolean;
|
|
335
339
|
/**
|
|
336
340
|
* This one-row box continues the line of the row above it: the break
|
|
337
341
|
* between them is a wrap, not a newline, so a fullscreen copy joins the
|
|
@@ -374,12 +378,15 @@ export type TextDecoration = {
|
|
|
374
378
|
/**
|
|
375
379
|
* Prefix painted before every row (the code frame's rail and padding).
|
|
376
380
|
* `width` is its display width; the wrap budget shrinks by it. The
|
|
377
|
-
* first `noSelect` columns are excluded from selection.
|
|
381
|
+
* first `noSelect` columns are excluded from selection. Soft-wrapped
|
|
382
|
+
* rows may exclude a different width via `continuationNoSelect`.
|
|
378
383
|
*/
|
|
379
384
|
readonly prefix?: {
|
|
380
385
|
readonly text: string;
|
|
381
386
|
readonly width: number;
|
|
382
387
|
readonly noSelect?: number;
|
|
388
|
+
/** Defaults to noSelect; excludes injected padding on continuations. */
|
|
389
|
+
readonly continuationNoSelect?: number;
|
|
383
390
|
};
|
|
384
391
|
/**
|
|
385
392
|
* Hang wrapped continuations of a source line under the line's leading
|