-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(terminal): add terminal emulator support (#7)
* wip(frontend): terminal + bottom pane * refactor(frontend/resizeHandler): consolidate repeated code reusable approach * feat(frontend/terminal): split terminal into it's own component * wip(terminal): initial structure * feat(frontend/terminal): add xterm.js + terminal with resizing * feat(frontend/terminal): visual enhancements * feat(frontend/terminal): multiple tabs * feat(frontend/terminal): shell selector * feat(frontend/terminal): improve terminal lifecycle and state handling 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 * feat(frontend/terminal): add tab navigation controls - 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 * fix(frontend/tabs): enhance tab scrolling behavior - 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 * feat(backend): add terminal service and core functionality - 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 * feat(terminal): implement terminal integration with backend communication - 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 * feat(terminal): switch terminal backend from tcell to pty - 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 * fix(frontend/terminal): adjust terminal sizing for bottom status bar - Calculate terminal rows accounting for status bar height - Add TODO comment for future dynamic status bar height handling * fix(frontend/terminal): enhance terminal component stability and performance - 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 * fix(frontend/terminal): improve terminal component stability and responsiveness - 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 * feat(frontend): improve terminal focus management and keyboard shortcuts - 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 * feat(frontend): improve keyboard context management and editor focus 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 * feat(terminal): add xterm addons and improve terminal management - 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
- Loading branch information
1 parent
dfc7fa2
commit e8a931c
Showing
25 changed files
with
1,254 additions
and
172 deletions.
There are no files selected for viewing
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
3a813aba7d4e8dc094101503060a82b6 | ||
2be276b66fa69ca283f64ddc7d9337aa |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<script lang="ts"> | ||
import { onMount, onDestroy } from 'svelte'; | ||
import { addKeyboardContext, removeKeyboardContext } from '@/stores/keyboardStore'; | ||
import type { BottomPaneState } from '@/types/ui'; | ||
import TerminalPane from '@/lib/editor/panes/TerminalPane.svelte'; | ||
import { bottomPaneStore } from '@/stores/bottomPaneStore'; | ||
export let state: BottomPaneState; | ||
export let height: number; | ||
onMount(() => { | ||
if (!state.collapsed) { | ||
addKeyboardContext('bottomPane'); | ||
} | ||
}); | ||
onDestroy(() => { | ||
removeKeyboardContext('bottomPane'); | ||
}); | ||
// Watch for state changes | ||
$: if (!state.collapsed) { | ||
addKeyboardContext('bottomPane'); | ||
} else { | ||
removeKeyboardContext('bottomPane'); | ||
} | ||
</script> | ||
|
||
<div class="w-full flex flex-col overflow-hidden border-t border-gray-800" style="height: {height}px"> | ||
<div class="flex items-center justify-between h-[35px] px-4 border-b border-gray-800"> | ||
<div class="flex items-center space-x-2"> | ||
<span class="text-sm font-medium"> | ||
{#if state.activeSection === 'terminal'} | ||
Terminal | ||
{:else if state.activeSection === 'problems'} | ||
Problems | ||
{:else if state.activeSection === 'output'} | ||
Output | ||
{/if} | ||
</span> | ||
</div> | ||
</div> | ||
|
||
<div class="flex-1 overflow-auto"> | ||
{#if state.activeSection === 'terminal'} | ||
<TerminalPane {height} /> | ||
{:else if state.activeSection === 'problems'} | ||
<div class="p-2"> | ||
<!-- Problems content will go here --> | ||
<p class="text-gray-500">No problems found.</p> | ||
</div> | ||
{:else if state.activeSection === 'output'} | ||
<div class="p-2"> | ||
<!-- Output content will go here --> | ||
<p class="text-gray-500">No output to display.</p> | ||
</div> | ||
{/if} | ||
</div> | ||
</div> |
Oops, something went wrong.