Skip to content

Commit b2644d3

Browse files
authored
refactor(shell-plugin): rename _FORGE_TERM_ENABLED to _FORGE_TERM (#3005)
1 parent 896d237 commit b2644d3

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

shell-plugin/lib/config.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typeset -h _FORGE_SESSION_REASONING_EFFORT
3838

3939
# Terminal context capture settings
4040
# Master switch for terminal context capture (preexec/precmd hooks)
41-
typeset -h _FORGE_TERM_ENABLED="${FORGE_TERM_ENABLED:-true}"
41+
typeset -h _FORGE_TERM="${FORGE_TERM:-true}"
4242
# Maximum number of commands to keep in the ring buffer (metadata: cmd + exit code)
4343
typeset -h _FORGE_TERM_MAX_COMMANDS="${FORGE_TERM_MAX_COMMANDS:-5}"
4444
# OSC 133 semantic prompt marker emission: "auto", "on", or "off"

shell-plugin/lib/context.zsh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ typeset -g _FORGE_TERM_PENDING_TS=""
6767
# Called before each command executes.
6868
# Records the command text and timestamp, emits OSC 133 B+C markers.
6969
function _forge_context_preexec() {
70-
[[ "$_FORGE_TERM_ENABLED" != "true" ]] && return
70+
[[ "$_FORGE_TERM" != "true" ]] && return
7171
_FORGE_TERM_PENDING_CMD="$1"
7272
_FORGE_TERM_PENDING_TS="$(date +%s)"
7373
# OSC 133 B: prompt end / command start
@@ -87,7 +87,7 @@ function _forge_context_precmd() {
8787
# even when context capture is disabled.
8888
_forge_osc133_emit "D;$last_exit"
8989

90-
[[ "$_FORGE_TERM_ENABLED" != "true" ]] && return
90+
[[ "$_FORGE_TERM" != "true" ]] && return
9191

9292
# Only record if we have a pending command from preexec
9393
if [[ -n "$_FORGE_TERM_PENDING_CMD" ]]; then
@@ -115,7 +115,7 @@ function _forge_context_precmd() {
115115
# Register using standard zsh hook arrays for coexistence with other plugins.
116116
# precmd is prepended so it runs first and captures the real $? from the
117117
# command, before other plugins (powerlevel10k, starship, etc.) overwrite it.
118-
if [[ "$_FORGE_TERM_ENABLED" == "true" ]]; then
118+
if [[ "$_FORGE_TERM" == "true" ]]; then
119119
preexec_functions+=(_forge_context_preexec)
120120
precmd_functions=(_forge_context_precmd "${precmd_functions[@]}")
121121
fi

shell-plugin/lib/helpers.zsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function _forge_exec() {
2929
# can legitimately contain colons (URLs, port mappings, paths, etc.).
3030
# Use `local -x` so the variables are exported only to the child forge
3131
# process and do not leak into the caller's shell environment.
32-
if [[ "$_FORGE_TERM_ENABLED" == "true" && ${#_FORGE_TERM_COMMANDS} -gt 0 ]]; then
32+
if [[ "$_FORGE_TERM" == "true" && ${#_FORGE_TERM_COMMANDS} -gt 0 ]]; then
3333
# Join the ring-buffer arrays with the ASCII Unit Separator (\x1F).
3434
# We use IFS-based joining ("${arr[*]}") rather than ${(j.SEP.)arr} because
3535
# zsh does NOT expand $'...' ANSI-C escapes inside parameter expansion flags.
@@ -66,7 +66,7 @@ function _forge_exec_interactive() {
6666
# Use `local -x` so the variables are exported only for the duration of
6767
# this function call (i.e. inherited by the child forge process) and do
6868
# not leak into the caller's shell environment.
69-
if [[ "$_FORGE_TERM_ENABLED" == "true" && ${#_FORGE_TERM_COMMANDS} -gt 0 ]]; then
69+
if [[ "$_FORGE_TERM" == "true" && ${#_FORGE_TERM_COMMANDS} -gt 0 ]]; then
7070
local _old_ifs="$IFS" _sep=$'\x1f'
7171
IFS="$_sep"
7272
local -x _FORGE_TERM_COMMANDS="${_FORGE_TERM_COMMANDS[*]}"

0 commit comments

Comments
 (0)