diff --git a/src/background/config_rc.ts b/src/background/config_rc.ts index 5b86da78..4bf90c88 100644 --- a/src/background/config_rc.ts +++ b/src/background/config_rc.ts @@ -59,17 +59,21 @@ export async function runRc(rc: string) { } export function rcFileToExCmds(rcText: string): string[] { - // string-join lines that end with / - const joined = rcText.replace(/\\\n/g, "") // Split into individual excmds - const excmds = joined.split("\n") + const excmds = rcText.split("\n") // Remove empty and comment lines - return excmds.filter( + const ex= excmds.filter( x => /\S/.test(x) && !x.trim().startsWith('"') && !x.trim().startsWith("#"), ) + const res= ex.join("\n") + + // string-join lines that end with / + const joined = res.replace(/\\\n/g, "") + + return joined.split("\n") }