MCPcopy
hub / github.com/vercel-labs/just-bash / getPrompt

Method getPrompt

packages/just-bash/src/cli/shell.ts:99–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97 }
98
99 private getPrompt(): string {
100 const cwd = this.env.getCwd();
101 const home = this.env.getEnv().HOME || "/home/user";
102
103 // Replace home with ~
104 let displayCwd = cwd;
105 if (cwd === home) {
106 displayCwd = "~";
107 } else if (cwd.startsWith(`${home}/`)) {
108 displayCwd = `~${cwd.slice(home.length)}`;
109 }
110
111 return `${colors.green}${colors.bold}user@virtual${colors.reset}:${colors.blue}${colors.bold}${displayCwd}${colors.reset}$ `;
112 }
113
114 private async executeCommand(command: string): Promise<void> {
115 const trimmed = command.trim();

Callers 1

promptMethod · 0.95

Calls 2

getCwdMethod · 0.80
getEnvMethod · 0.80

Tested by

no test coverage detected