diff --git a/docs/project/changelog.md b/docs/project/changelog.md index 3956dddf2..225779756 100644 --- a/docs/project/changelog.md +++ b/docs/project/changelog.md @@ -36,6 +36,9 @@ substitutions: improved with some context information. {pr}`2121` +- {{Enhancement}} Pressing TAB in REPL no longer triggers completion when input + is whitespace. {pr}`2125` + ## Version 0.19.0 _January 10, 2021_ diff --git a/src/templates/console.html b/src/templates/console.html index c5c3ef029..3fc16ee38 100644 --- a/src/templates/console.html +++ b/src/templates/console.html @@ -133,6 +133,15 @@ term.set_command(""); term.set_prompt(ps1); }, + "TAB": (event, original) => { + const command = term.before_cursor(); + // Disable completion for whitespaces. + if (command.trim() === "") { + term.insert("\t"); + return false; + } + return original(event); + } }, }); window.term = term;