Some checks failed
Build & Sign Wraith / Build Windows + Sign (push) Failing after 16s
The + button in the tab bar now shows a dropdown of detected local shells. Clicking one opens a full-size PTY terminal in the main content area as a proper tab — not the copilot sidebar. - New "local" protocol type in Session interface - LocalTerminalView component uses useTerminal(id, 'pty') - SessionContainer renders local sessions alongside SSH/RDP - TabBadge shows purple dot for local sessions - Shell detection includes WSL (wsl.exe) on Windows - closeSession handles PTY disconnect for local tabs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
52 lines
1.0 KiB
Vue
52 lines
1.0 KiB
Vue
<template>
|
|
<div class="flex flex-col h-full">
|
|
<div
|
|
ref="containerRef"
|
|
class="terminal-container flex-1"
|
|
@click="terminal.focus()"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref, onMounted, watch } from "vue";
|
|
import { invoke } from "@tauri-apps/api/core";
|
|
import { useTerminal } from "@/composables/useTerminal";
|
|
import "@/assets/css/terminal.css";
|
|
|
|
const props = defineProps<{
|
|
sessionId: string;
|
|
isActive: boolean;
|
|
}>();
|
|
|
|
const containerRef = ref<HTMLElement | null>(null);
|
|
const { terminal, mount, fit } = useTerminal(props.sessionId, "pty");
|
|
|
|
onMounted(() => {
|
|
if (containerRef.value) {
|
|
mount(containerRef.value);
|
|
}
|
|
setTimeout(() => {
|
|
fit();
|
|
terminal.focus();
|
|
invoke("pty_resize", {
|
|
sessionId: props.sessionId,
|
|
cols: terminal.cols,
|
|
rows: terminal.rows,
|
|
}).catch(() => {});
|
|
}, 50);
|
|
});
|
|
|
|
watch(
|
|
() => props.isActive,
|
|
(active) => {
|
|
if (active) {
|
|
setTimeout(() => {
|
|
fit();
|
|
terminal.focus();
|
|
}, 0);
|
|
}
|
|
},
|
|
);
|
|
</script>
|