Skip to content

Commit 16f92ff

Browse files
committed
fix(cli-repl): clear window title when mongosh exits MONGOSH-1233
Terminals do not provide an easy way to "push/pop" window titles, so we're basically stuck with clearing the window title when mongosh exits on a best-effort basis. When somebody brings this up as an issue, we should still recommend them to include something in their shell's .rc file to automatically reset window titles after each shell command.
1 parent 3c88417 commit 16f92ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/cli-repl/src/run.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,8 @@ function suppressExperimentalWarnings() {
346346
}
347347

348348
function onExit(code?: number): never {
349+
setTerminalWindowTitle(''); // Clear the terminal window title MONGOSH-1233
350+
349351
// Node.js 20.0.0 made p.exit(undefined) behave as p.exit(0) rather than p.exit(): (code?: number | undefined): never => {
350352
try {
351353
try {

0 commit comments

Comments
 (0)