fix(workshop-console): ■ 종료 시 화면·스크롤 기록을 지우고, 세션은 유지한 채 지우는 🧹 지우기 버튼 추가
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
068bc92e33
commit
16c851c018
2 files changed
+10
-2
No files matched your search
@@ -147,6 +147,7 @@
|
||||
<button class="hdr-btn" onclick="consoleStart('claude')">▶ claude 시작</button>
|
||||
<button class="hdr-btn" onclick="consoleStart('shell')">🐚 셸</button>
|
||||
<button class="hdr-btn" onclick="consoleStop()">■ 종료</button>
|
||||
<button class="hdr-btn" onclick="consoleClear()" title="화면 지우기(세션은 유지)">🧹 지우기</button>
|
||||
<span id="console-status" class="rb-console-status"></span>
|
||||
</div>
|
||||
<div class="rb-console-warn">⚠ 서버 전체에 접근하는 터미널입니다(관리자 로그인 + 같은 주소에서만 열림). Claude Code의 권한 확인 질문에는 신중히 답하세요.</div>
|
||||
|
||||
@@ -65,7 +65,7 @@ async function openConsole() {
|
||||
consoleTerm.onData(d => { if (consoleShellId) consoleSend({ type: 'pty_input', shellId: consoleShellId, data: d }); });
|
||||
consoleTerm.onResize(({ cols, rows }) => { if (consoleShellId) consoleSend({ type: 'pty_resize', shellId: consoleShellId, cols, rows }); });
|
||||
window.addEventListener('resize', () => { if (consoleOpen) consoleRefit(); });
|
||||
consoleTerm.write('\x1b[90m▶ claude 시작을 누르면 이 프로젝트 폴더에서 Claude Code가 실행됩니다.\x1b[0m\r\n');
|
||||
consoleTerm.write(CONSOLE_HINT);
|
||||
}
|
||||
consoleOnProjectChange(true);
|
||||
setTimeout(consoleRefit, 50);
|
||||
@@ -89,9 +89,16 @@ async function consoleStart(mode) {
|
||||
consoleStatus((mode === 'claude' ? 'Claude Code' : '셸') + ' 실행 중 — ' + proj.name, '#22c55e');
|
||||
consoleTerm.focus();
|
||||
}
|
||||
const CONSOLE_HINT = '\x1b[90m▶ claude 시작을 누르면 이 프로젝트 폴더에서 Claude Code가 실행됩니다.\x1b[0m\r\n';
|
||||
function consoleClear() {
|
||||
if (!consoleTerm) return;
|
||||
consoleTerm.reset(); // 화면과 스크롤 기록을 모두 지운다
|
||||
consoleTerm.write(CONSOLE_HINT);
|
||||
}
|
||||
function consoleStop(silent) {
|
||||
if (consoleShellId) { consoleSend({ type: 'pty_kill', shellId: consoleShellId }); consoleShellId = null; }
|
||||
if (!silent) consoleStatus('종료됨');
|
||||
// 사용자가 ■ 종료를 눌렀을 때는 화면을 비운다(다시 시작할 때 이전 세션 내용과 섞이지 않게). silent는 재시작·프로젝트 전환 내부 호출.
|
||||
if (!silent) { consoleClear(); consoleStatus('종료됨'); }
|
||||
}
|
||||
// 프로젝트를 바꾸면 실행 중인 세션은 이전 프로젝트 폴더 기준이라 혼동되므로 종료하고 안내한다.
|
||||
function consoleOnProjectChange(fromOpen) {
|
||||
|
||||
Reference in new issue
Block a user