feat(terminal): add terminal emulator support - #7
Merged
Conversation
1. Better cleanup of terminal instances 2. Proper handling of component lifecycle 3. Prevention of operations on destroyed terminals 4. Improved state management in the store 5. Prevent line wrap
- Add scroll buttons for terminal tabs (left/right navigation) - Implement smooth tab scrolling behavior - Hide scrollbars while maintaining scroll functionality - Add visual separators between navigation controls - Auto-scroll to active tab when selected
- Add smooth centering of tabs in container - Add delay for DOM updates before scrolling - Return new tab ID from store for immediate reference - Improve tab scroll positioning calculation
- Add terminal service for managing multiple terminal instances - Implement terminal screen handling with tcell library - Add terminal event handling and lifecycle management - Add terminal input/output processing - Implement terminal resize functionality - Add cursor position tracking and screen content management - Add terminal options configuration support
…tion - Add TerminalService with terminal instance management - Implement terminal event handling and lifecycle management - Add terminal resize functionality and cursor tracking - Integrate terminal frontend with backend communication - Add terminal input/output handling - Implement terminal creation and destruction endpoints - Add terminal event notification system
- Migrate terminal backend from tcell to pty for full TTY support - Add base64 encoding/decoding for terminal data - Add debug logs for terminal operations - Enhance terminal event handling with PTY lifecycle - Improve error handling and terminal cleanup - Add TERM environment variable configuration - Remove screen.go and simplify terminal architecture - Update terminal resizing to use PTY native functions
- Calculate terminal rows accounting for status bar height - Add TODO comment for future dynamic status bar height handling
…ormance - Refactor terminal component for better lifecycle management - Improve terminal initialization and cleanup logic - Add base64 encoding for input handling - Optimize terminal resizing and event handling - Fix terminal tab visibility with absolute positioning - Add isInitialized flag to prevent duplicate initialization
…onsiveness - Add active state detection and auto-focus for terminals - Implement debounced resize handling with 100ms delay - Fix terminal tab switching behavior and focus management - Add resize timeout cleanup on component destroy - Adjust status bar height calculation to 3 rows - Fix type safety with null checks
- Add automatic terminal focus handling when switching tabs - Implement ctrl+j shortcut to open terminal panel - Add terminal state management with bottomPaneStore - Improve keyboard context switching between editor and terminal - Add focus method to XtermComponent for external control - Update tab click behavior to focus terminal automatically - Fix keyboard context handling in bottom pane collapse state
…handling - Add focus tracking and restoration between editor and terminal - Implement Alt+J shortcut to return to previous context - Add keyboard event handling for terminal shortcuts - Improve editor focus management with focusStore integration - Format keyboard store code for better readability
- Add xterm addons (fit, search, webgl) for enhanced terminal functionality - Implement terminal manager for better instance tracking and lifecycle - Add terminal ID-based management and cleanup - Update terminal service to handle ID-based operations - Refactor terminal creation and destruction logic
Contributor
There was a problem hiding this comment.
Copilot reviewed 10 out of 25 changed files in this pull request and generated no comments.
Files not reviewed (15)
- frontend/package-lock.json: Language not supported
- frontend/package.json: Language not supported
- frontend/package.json.md5: Language not supported
- frontend/src/lib/components/Select.svelte: Language not supported
- frontend/src/lib/editor/Editor.svelte: Language not supported
- frontend/src/lib/editor/ResizeHandle.svelte: Language not supported
- frontend/src/lib/editor/panes/BottomPane.svelte: Language not supported
- frontend/src/lib/editor/panes/TerminalPane.svelte: Language not supported
- frontend/src/lib/terminal/XtermComponent.svelte: Language not supported
- frontend/src/routes/Editor.svelte: Language not supported
- go.mod: Language not supported
- frontend/src/stores/keyboardStore.ts: Evaluated as low risk
- frontend/src/stores/terminalStore.ts: Evaluated as low risk
- frontend/src/types/keyboard.ts: Evaluated as low risk
- frontend/src/types/ui.ts: Evaluated as low risk
Comments suppressed due to low confidence (1)
frontend/src/lib/terminal/types.ts:1
- This file is empty and should either be removed or populated with relevant content.
+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a terminal feature to the application and includes various updates to support this functionality. The changes span across the backend (
app.go) and frontend (package-lock.json,package.json, and several Svelte components).Backend changes:
TerminalServiceto theAppstruct and initialized it in thestartupmethod. This service handles terminal events and communicates with the frontend. (app.go) [1] [2] [3]Appfor creating, destroying, resizing terminals, and handling terminal input. (app.go)Frontend changes:
xterm.jsand its addons for terminal emulation. (package-lock.json,package.json) [1] [2] [3] [4]TerminalPane.svelteto manage terminal tabs and interactions. (frontend/src/lib/editor/panes/TerminalPane.svelte)BottomPane.svelteto encapsulate the bottom pane of the editor, which includes the terminal. (frontend/src/lib/editor/panes/BottomPane.svelte)ResizeHandle.svelteto support both vertical and horizontal resizing, improving the UI/UX for resizing panes. (frontend/src/lib/editor/ResizeHandle.svelte) [1] [2] [3]Select.svelteto usetailwind-mergefor better class merging. (frontend/src/lib/components/Select.svelte) [1] [2]These changes collectively add a robust terminal feature to the application, enhancing its functionality and user experience.