MISC: Various small fixes (#574)

* ns.ls filter can include leading slash in filename
* scp from terminal accepts multiple filenames
* terminal displays root / instead of ~ as base
* cd with no args returns to root
This commit is contained in:
Snarling
2023-06-06 08:46:07 -04:00
committed by GitHub
parent ed93fea141
commit 40b89baca1
6 changed files with 77 additions and 50 deletions
@@ -163,7 +163,7 @@ export async function getTabCompletionPossibilities(terminalText: string, baseDi
// Just some booleans so the mismatch between command length and arg number are not as confusing.
const onCommand = commandLength === 1;
const onFirstCommandArg = commandLength === 2;
const onSecondCommandArg = commandLength === 3;
// const onSecondCommandArg = commandLength === 3; // unused
// These are always added.
addGlobalAliases();
@@ -239,11 +239,12 @@ export async function getTabCompletionPossibilities(terminalText: string, baseDi
return possibilities;
case "scp":
if (onFirstCommandArg) {
addScripts();
addTextFiles();
addLiterature();
} else if (onSecondCommandArg) addServerNames();
if (!onFirstCommandArg) {
addServerNames();
}
addScripts();
addTextFiles();
addLiterature();
return possibilities;
case "rm":