fix(spawn): strip ANSI codes from zellij list-sessions output
Zellij outputs colored text with ANSI escape codes, which caused session name parsing to fail. Now strips escape codes before parsing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -75,12 +75,15 @@ export function SpawnModal({ isOpen, onClose, onSpawn, currentProject }) {
|
||||
}, [isOpen, handleClose]);
|
||||
|
||||
const handleSpawn = async () => {
|
||||
const project = currentProject || selectedProject;
|
||||
if (!project) {
|
||||
const rawProject = currentProject || selectedProject;
|
||||
if (!rawProject) {
|
||||
setError('Please select a project');
|
||||
return;
|
||||
}
|
||||
|
||||
// Extract project name from full path (sidebar passes projectDir like "/Users/.../projects/amc")
|
||||
const project = rawProject.includes('/') ? rawProject.split('/').pop() : rawProject;
|
||||
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
|
||||
@@ -169,7 +172,7 @@ export function SpawnModal({ isOpen, onClose, onSpawn, currentProject }) {
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<label class="text-label font-medium text-dim">Project</label>
|
||||
<div class="rounded-xl border border-selection/75 bg-bg/70 px-3 py-2 text-sm text-bright">
|
||||
${currentProject}
|
||||
${currentProject.includes('/') ? currentProject.split('/').pop() : currentProject}
|
||||
</div>
|
||||
</div>
|
||||
`}
|
||||
|
||||
Reference in New Issue
Block a user