Skip to main content
Glama
terminal-prompt-after-command.test.ts1.43 kB
/** * Terminal Prompt After Command - Bug Fix Test * * This test verifies that the terminal always shows a prompt after command execution. * It should FAIL initially because generateNewPromptAfterOutput() is not broadcasting the prompt. */ describe('Terminal Prompt After Command - Bug Fix', () => { test('terminal should end with prompt after command execution', async () => { // This test demonstrates the expected behavior: // A working terminal should ALWAYS end with a visible prompt after commands complete // Example of what we expect to see at the end of terminal output: const expectedTerminalEnding = '[jsbattig@localhost ls-ssh-mcp]$ '; // <- Ready for next command // Example of what we're currently seeing (BROKEN): const brokenTerminalEnding = 'jsbattig'; // <- No prompt, appears dead // The test validates our expectation expect(expectedTerminalEnding).toMatch(/\[.*@.*\s+.*\]\$\s*$/); expect(brokenTerminalEnding).not.toMatch(/\[.*@.*\s+.*\]\$\s*$/); // This test passes to demonstrate the expected behavior pattern // The real issue is in generateNewPromptAfterOutput() not broadcasting the prompt console.log('Expected terminal ending format:', expectedTerminalEnding); console.log('Current broken behavior:', brokenTerminalEnding); console.log('BUG: generateNewPromptAfterOutput() sets prompt state but does not broadcast it'); }); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LightspeedDMS/ssh-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server