@rse/claudex 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
  ChangeLog
3
3
  =========
4
4
 
5
+ 1.0.4 (2026-05-10)
6
+ ------------------
7
+
8
+ - IMPROVEMENT: set `ASE_HEADLESS=true` when option -A/--ase and -p/--print are given
9
+
10
+ 1.0.3 (2026-05-10)
11
+ ------------------
12
+
13
+ - BUGFIX: ignore global -T (tmux) option of claude -p (print) option is present
14
+
5
15
  1.0.2 (2026-05-10)
6
16
  ------------------
7
17
 
package/claudex.js CHANGED
@@ -909,24 +909,26 @@ const actionDefault = (opts, args) => {
909
909
  }
910
910
  /* override ASE configuration (for its diagram rendering) */
911
911
  if (opts.ase) {
912
- if (process.env.ASE_TERM_WIDTH === undefined) {
912
+ if (env.ASE_TERM_WIDTH === undefined) {
913
913
  let width = 0;
914
914
  if (process.stdout.isTTY) {
915
915
  const cols = process.stdout.columns;
916
916
  if (typeof cols === "number" && cols > 0)
917
917
  width = cols;
918
918
  }
919
- process.env.ASE_TERM_WIDTH = `${width}`;
919
+ env.ASE_TERM_WIDTH = `${width}`;
920
920
  }
921
- if (process.env.ASE_TERM_COLORS === undefined) {
921
+ if (env.ASE_TERM_COLORS === undefined) {
922
922
  let colorMode = "none";
923
923
  const depth = process.stdout.getColorDepth();
924
924
  if (depth >= 8)
925
925
  colorMode = "ansi256";
926
926
  else if (depth >= 4)
927
927
  colorMode = "ansi16";
928
- process.env.ASE_TERM_COLORS = `${colorMode}`;
928
+ env.ASE_TERM_COLORS = `${colorMode}`;
929
929
  }
930
+ if (args.includes("-p") || args.includes("--print"))
931
+ env.ASE_HEADLESS = "true";
930
932
  }
931
933
  /* determine Claude Code settings */
932
934
  let claudeSettings = {
@@ -1027,6 +1029,8 @@ const main = async () => {
1027
1029
  ];
1028
1030
  const isClaudeNative = claudeNativeSubcmds.includes(subcmd);
1029
1031
  if (envFlags !== "" && subcmd !== "internal" && !isClaudeNative) {
1032
+ const tokens = envFlags.split(/\s+/).filter((t) => t !== "");
1033
+ /* provide check whether global options are present */
1030
1034
  const aliases = {
1031
1035
  "-R": "--recolor", "--recolor": "-R",
1032
1036
  "-C": "--capsula", "--capsula": "-C",
@@ -1041,8 +1045,24 @@ const main = async () => {
1041
1045
  return true;
1042
1046
  return false;
1043
1047
  };
1044
- const tokens = envFlags.split(/\s+/).filter((t) => t !== "");
1045
- const toInsert = tokens.filter((t) => !present(t));
1048
+ /* ignore "-T"/"--tmux" from CLAUDEX_FLAGS when claude is
1049
+ invoked with any of these options, as the corresponding
1050
+ non-interactive or session-related modes are incompatible
1051
+ with wrapping claude inside a Tmux session */
1052
+ const noTmuxOpts = ["-p"];
1053
+ const skipTmux = topArgs.some((a) => noTmuxOpts.includes(a));
1054
+ const filtered = [];
1055
+ for (let i = 0; i < tokens.length; i++) {
1056
+ const t = tokens[i];
1057
+ if (skipTmux && (t === "-T" || t === "--tmux")) {
1058
+ if (i + 1 < tokens.length && !tokens[i + 1].startsWith("-"))
1059
+ i++;
1060
+ continue;
1061
+ }
1062
+ filtered.push(t);
1063
+ }
1064
+ /* insert in front of the other arguments */
1065
+ const toInsert = filtered.filter((t) => !present(t));
1046
1066
  if (toInsert.length > 0)
1047
1067
  process.argv.splice(2, 0, ...toInsert);
1048
1068
  }
package/claudex.ts CHANGED
@@ -1007,24 +1007,26 @@ const actionDefault = (opts: TopOpts, args: string[]): never => {
1007
1007
 
1008
1008
  /* override ASE configuration (for its diagram rendering) */
1009
1009
  if (opts.ase) {
1010
- if (process.env.ASE_TERM_WIDTH === undefined) {
1010
+ if (env.ASE_TERM_WIDTH === undefined) {
1011
1011
  let width = 0
1012
1012
  if (process.stdout.isTTY) {
1013
1013
  const cols = process.stdout.columns
1014
1014
  if (typeof cols === "number" && cols > 0)
1015
1015
  width = cols
1016
1016
  }
1017
- process.env.ASE_TERM_WIDTH = `${width}`
1017
+ env.ASE_TERM_WIDTH = `${width}`
1018
1018
  }
1019
- if (process.env.ASE_TERM_COLORS === undefined) {
1019
+ if (env.ASE_TERM_COLORS === undefined) {
1020
1020
  let colorMode = "none"
1021
1021
  const depth = process.stdout.getColorDepth()
1022
1022
  if (depth >= 8)
1023
1023
  colorMode = "ansi256"
1024
1024
  else if (depth >= 4)
1025
1025
  colorMode = "ansi16"
1026
- process.env.ASE_TERM_COLORS = `${colorMode}`
1026
+ env.ASE_TERM_COLORS = `${colorMode}`
1027
1027
  }
1028
+ if (args.includes("-p") || args.includes("--print"))
1029
+ env.ASE_HEADLESS = "true"
1028
1030
  }
1029
1031
 
1030
1032
  /* determine Claude Code settings */
@@ -1132,6 +1134,9 @@ const main = async (): Promise<void> => {
1132
1134
  ]
1133
1135
  const isClaudeNative = claudeNativeSubcmds.includes(subcmd)
1134
1136
  if (envFlags !== "" && subcmd !== "internal" && !isClaudeNative) {
1137
+ const tokens = envFlags.split(/\s+/).filter((t) => t !== "")
1138
+
1139
+ /* provide check whether global options are present */
1135
1140
  const aliases: Record<string, string> = {
1136
1141
  "-R": "--recolor", "--recolor": "-R",
1137
1142
  "-C": "--capsula", "--capsula": "-C",
@@ -1146,8 +1151,26 @@ const main = async (): Promise<void> => {
1146
1151
  return true
1147
1152
  return false
1148
1153
  }
1149
- const tokens = envFlags.split(/\s+/).filter((t) => t !== "")
1150
- const toInsert = tokens.filter((t) => !present(t))
1154
+
1155
+ /* ignore "-T"/"--tmux" from CLAUDEX_FLAGS when claude is
1156
+ invoked with any of these options, as the corresponding
1157
+ non-interactive or session-related modes are incompatible
1158
+ with wrapping claude inside a Tmux session */
1159
+ const noTmuxOpts = [ "-p" ]
1160
+ const skipTmux = topArgs.some((a) => noTmuxOpts.includes(a))
1161
+ const filtered: string[] = []
1162
+ for (let i = 0; i < tokens.length; i++) {
1163
+ const t = tokens[i]
1164
+ if (skipTmux && (t === "-T" || t === "--tmux")) {
1165
+ if (i + 1 < tokens.length && !tokens[i + 1].startsWith("-"))
1166
+ i++
1167
+ continue
1168
+ }
1169
+ filtered.push(t)
1170
+ }
1171
+
1172
+ /* insert in front of the other arguments */
1173
+ const toInsert = filtered.filter((t) => !present(t))
1151
1174
  if (toInsert.length > 0)
1152
1175
  process.argv.splice(2, 0, ...toInsert)
1153
1176
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rse/claudex",
3
3
  "publishConfig": { "access": "public" },
4
- "version": "1.0.2",
4
+ "version": "1.0.4",
5
5
  "description": "Claude Code eXtended",
6
6
  "type": "module",
7
7
  "keywords": [ "claude", "code", "extension", "wrapper" ],