This commit is contained in:
Baobhan Sith
2025-05-28 11:04:54 +08:00
parent 50f3724ef8
commit 3bc2a07ec9
3 changed files with 13 additions and 15 deletions
@@ -571,15 +571,6 @@ onMounted(() => {
terminalRef.value.addEventListener('touchcancel', handleTouchEnd, { passive: false }); // Also handle cancel
}
// Listen for favorite path to send to terminal
subscribeToWorkspaceEvent('favoritePath:sendToActiveTerminal', ({ path }) => {
if (terminal && props.isActive && sessionStore.activeSessionId === props.sessionId) {
// Ensure path is quoted to handle spaces or special characters
const command = `cd "${path.replace(/"/g, '\\"')}"\n`; // Escape existing quotes in path
emitWorkspaceEvent('terminal:input', { sessionId: props.sessionId, data: command });
terminal.focus(); // Focus terminal after sending command
}
});
}
});
@@ -624,7 +615,6 @@ onBeforeUnmount(() => {
terminalRef.value.removeEventListener('touchcancel', handleTouchEnd);
}
unsubscribeFromWorkspaceEvent('favoritePath:sendToActiveTerminal');
});