about summary refs log tree commit diff stats
path: root/src/main.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-11-13 19:07:46 +0100
committerbptato <nincsnevem662@gmail.com>2024-11-13 19:25:11 +0100
commit9cd0a27edcf3d1b7a9c5489cbfdadafc5c619591 (patch)
tree5e84a7dcb6d4e4dac5ceb48230eabcda15f910a4 /src/main.nim
parenta9e70cc2b5bb3694f64ef453b52b4127b6ac08cc (diff)
downloadchawan-9cd0a27edcf3d1b7a9c5489cbfdadafc5c619591.tar.gz
chapath: fix a few more bugs, simplify
* fix incorrect :- behavior
* merge non-standard '${%VARIABLE}' syntax with regular syntax; now all
  internal variables are exported to the environment, so the behavior
  should be equivalent.
* handle terminal symbol appropriately in all states
* deny numeric curly substitutions
Diffstat (limited to 'src/main.nim')
-rw-r--r--src/main.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.nim b/src/main.nim
index f7d6a87a..8ef2d50d 100644
--- a/src/main.nim
+++ b/src/main.nim
@@ -223,8 +223,11 @@ proc initConfig(ctx: ParamParseContext; config: Config;
   isCJKAmbiguous = config.display.double_width_ambiguous
   return ok()
 
+const libexecPath {.strdefine.} = "$CHA_BIN_DIR/../libexec/chawan"
+
 proc main() =
-  putEnv("CHA_LIBEXEC_DIR", ChaPath"${%CHA_LIBEXEC_DIR}".unquoteGet())
+  putEnv("CHA_BIN_DIR", getAppFileName().beforeLast('/'))
+  putEnv("CHA_LIBEXEC_DIR", ChaPath(libexecPath).unquoteGet())
   let forkserver = newForkServer()
   var ctx = ParamParseContext(params: commandLineParams(), i: 0)
   ctx.parse()