* Get the shell's current working directory. * Runs `pwd` (POSIX) or `cd` (Windows) — useful for status display.
()
| 246 | * Runs `pwd` (POSIX) or `cd` (Windows) — useful for status display. |
| 247 | */ |
| 248 | async pwd() { |
| 249 | const isWin = process.platform === 'win32'; |
| 250 | const r = await this.run(isWin ? 'cd' : 'pwd'); |
| 251 | return r.stdout.trim().split('\n')[0] || this.cwd; |
| 252 | } |
| 253 | |
| 254 | /** |
| 255 | * Reset the shell — kill the current process and spawn a fresh one. |