You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remember terminal drawer height and right panel state/width across threads (+ workaround)
#16825
The terminal drawer and the right panel are saved per thread. Every new thread starts with the hardcoded defaults:
terminal drawer (Ctrl+J) closed, and 280px tall when opened (the minimum is 180px)
right panel (Ctrl+Alt+B) closed, and 540px wide when opened (the minimum is 360px)
If you always work with both open, you have to open (and resize) them again in every thread. There is no setting for this today.
Proposal
Any of these would solve it:
New threads start with the last state/size used (one global value instead of one per thread).
Settings for "open terminal by default", "open right panel by default", the default terminal drawer height, and the default right panel width.
The same settings per project (in project settings), overriding the global default. For example: terminal open by default only in projects where you run commands, or a wider right panel only in projects where you review diffs.
Until this exists, you can patch the bundled app.asar. Every replacement keeps the same byte length, so no repacking is needed. Pick one option:
Option A: open
Option B: open minimum
Terminal drawer opens by itself in every thread
yes
yes
Right panel opens by itself in every thread
yes
yes
Terminal drawer default height
280px (unchanged)
180px
Right panel default width
540px (unchanged)
360px
How it behaves:
The terminal opens (with a new shell) when you enter a thread that has no terminal yet, the same as pressing Ctrl+J. If you close the drawer, it stays closed in that thread.
The right panel can still be closed, and closing it is remembered per thread.
Threads that already have a saved terminal height or panel width keep it.
Notes:
Works with the .deb, .rpm and tar.gz installs (it finds app.asar next to the t3code binary). It does not work with the AppImage, because its files are read-only. If the script can't find your install, run it with T3_ASAR=/path/to/resources/app.asar.
sudo is only used when app.asar isn't writable by you (e.g. /opt, owned by root). In that case run it from a system terminal, not from T3's own terminal: T3 runs with the no new privileges flag, so sudo fails inside it.
The alias goes to ~/.bashrc and ~/.zshrc (whichever exist). Running the other option's block later switches the alias and the patch.
Every T3 update replaces app.asar, so the patch has to be applied again (see below).
The patch matches minified code from 0.0.45. If an update changes that code, the script prints MISSING for each change it could not apply and exits with an error.
Option A: terminal and right panel open by default (paste and apply)
Show command
mkdir -p ~/.local/bin && cat >~/.local/bin/t3-patch-asar.sh <<'EOF'#!/usr/bin/env bash# Re-applies T3 Code layout defaults after each update.# Groups (can be combined, e.g. t3-patch-asar.sh open minimum):# open terminal drawer (Ctrl+J) and right panel (Ctrl+Alt+B) open by themselves in every thread# minimum terminal drawer at 180px and right panel at 360px (the minimums)# --revert restore T3's original defaults# Groups you don't pass go back to the original, so you can switch combinations by running it again.# Uses sudo when app.asar is root-owned: run it from a system terminal, not T3's terminal ("no new privileges" flag).set -euo pipefail# Find app.asar: $T3_ASAR, then next to the t3code binary (.deb, .rpm, tar.gz), then /opt defaultsfind_asar() { local binary if [ -n "${T3_ASAR:-}" ]; then echo "$T3_ASAR"; return; fi binary="$(command -v t3code 2>/dev/null || true)" if [ -n "$binary" ] && [ -f "$(dirname "$(readlink -f "$binary")")/resources/app.asar" ]; then echo "$(dirname "$(readlink -f "$binary")")/resources/app.asar"; return fi for candidate in "/opt/T3 Code (Alpha)/resources/app.asar" "/opt/T3 Code/resources/app.asar"; do if [ -f "$candidate" ]; then echo "$candidate"; return; fi done}# Each index: group, original T3 code, patched code (same byte length)CHANGE_GROUPS=( 'open' 'open' 'open' 'minimum' 'minimum' 'minimum' 'minimum')ORIGINALS=( 'f={isOpen:!1,activeSurfaceId:null,surfaces:[]}' 'if(!i.isOpen&&i.activeSurfaceId===null&&i.surfaces.length===0' 'Sd(e)},[ha,ri,X,bu,Ui,t,nu,A,Sd,Sr,yr.terminalIds.length,yr.terminalOpen]),Od=(0,Z.useCallback)' 'terminalOpen:!1,terminalHeight:280,terminalIds:[]' 'e.terminalHeight>0?e.terminalHeight:280' 'isFinite(e)?e:280,n=' 'hi=360,gi=.7,_i=540,vi=360')PATCHED=( 'f={isOpen:!0,activeSurfaceId:null,surfaces:[]}' 'if( i.isOpen&&i.activeSurfaceId===null&&i.surfaces.length===0' 'Sd(e)}),Ed_=(0,Z.useEffect)(()=>{yr.terminalIds.length||Ed()},[vi,ri,ha]) ,Od=(0,Z.useCallback)' 'terminalOpen:!1,terminalHeight:180,terminalIds:[]' 'e.terminalHeight>0?e.terminalHeight:180' 'isFinite(e)?e:180,n=' 'hi=360,gi=.7,_i=360,vi=360')if [ "$#" -eq 0 ]; then echo "Usage: $0 [open] [minimum] | --revert"; exit 1; fienabled_groups=" "for group in "$@"; do case "$group" in open|minimum) enabled_groups+="$group " ;; --revert) ;; *) echo "Unknown group: $group"; echo "Usage: $0 [open] [minimum] | --revert"; exit 1 ;; esacdoneASAR="$(find_asar)"if [ -z "$ASAR" ] || [ ! -f "$ASAR" ]; then echo "app.asar not found. Run again with T3_ASAR=/path/to/resources/app.asar" exit 1fiecho "patching: $ASAR"SUDO=sudo[ -w "$ASAR" ] && SUDO=""escape_pattern() { printf '%s' "$1" | sed 's/[][\.*^$/]/\\&/g'; }escape_replacement() { printf '%s' "$1" | sed 's/[\/&]/\\&/g'; }sed_arguments=()expected=()for index in "${!CHANGE_GROUPS[@]}"; do if [[ "$enabled_groups" == *" ${CHANGE_GROUPS[$index]} "* ]]; then source_text="${ORIGINALS[$index]}"; target_text="${PATCHED[$index]}" else source_text="${PATCHED[$index]}"; target_text="${ORIGINALS[$index]}" fi sed_arguments+=(-e "s/$(escape_pattern "$source_text")/$(escape_replacement "$target_text")/") expected+=("$target_text")done$SUDO sed -i "${sed_arguments[@]}" "$ASAR"missing=0for index in "${!expected[@]}"; do label="${CHANGE_GROUPS[$index]}: ${expected[$index]:0:70}" if grep -aqF "${expected[$index]}" "$ASAR"; then echo "ok $label" else echo "MISSING $label" missing=1 fidoneif [ "$missing" -eq 1 ]; then echo "Some code changed in this T3 update: the patch needs to be reviewed." exit 1fiecho "Done. Quit and reopen T3."EOF
chmod +x ~/.local/bin/t3-patch-asar.sh
forrcin~/.bashrc ~/.zshrc;do
[ -f"$rc" ] ||continue
sed -i '/alias configt3chatafterupdate=/d'"$rc"echo"alias configt3chatafterupdate='~/.local/bin/t3-patch-asar.sh open'">>"$rc"done~/.local/bin/t3-patch-asar.sh open
Option B: terminal and right panel open by default, at their minimum size (paste and apply)
Show command
mkdir -p ~/.local/bin && cat >~/.local/bin/t3-patch-asar.sh <<'EOF'#!/usr/bin/env bash# Re-applies T3 Code layout defaults after each update.# Groups (can be combined, e.g. t3-patch-asar.sh open minimum):# open terminal drawer (Ctrl+J) and right panel (Ctrl+Alt+B) open by themselves in every thread# minimum terminal drawer at 180px and right panel at 360px (the minimums)# --revert restore T3's original defaults# Groups you don't pass go back to the original, so you can switch combinations by running it again.# Uses sudo when app.asar is root-owned: run it from a system terminal, not T3's terminal ("no new privileges" flag).set -euo pipefail# Find app.asar: $T3_ASAR, then next to the t3code binary (.deb, .rpm, tar.gz), then /opt defaultsfind_asar() { local binary if [ -n "${T3_ASAR:-}" ]; then echo "$T3_ASAR"; return; fi binary="$(command -v t3code 2>/dev/null || true)" if [ -n "$binary" ] && [ -f "$(dirname "$(readlink -f "$binary")")/resources/app.asar" ]; then echo "$(dirname "$(readlink -f "$binary")")/resources/app.asar"; return fi for candidate in "/opt/T3 Code (Alpha)/resources/app.asar" "/opt/T3 Code/resources/app.asar"; do if [ -f "$candidate" ]; then echo "$candidate"; return; fi done}# Each index: group, original T3 code, patched code (same byte length)CHANGE_GROUPS=( 'open' 'open' 'open' 'minimum' 'minimum' 'minimum' 'minimum')ORIGINALS=( 'f={isOpen:!1,activeSurfaceId:null,surfaces:[]}' 'if(!i.isOpen&&i.activeSurfaceId===null&&i.surfaces.length===0' 'Sd(e)},[ha,ri,X,bu,Ui,t,nu,A,Sd,Sr,yr.terminalIds.length,yr.terminalOpen]),Od=(0,Z.useCallback)' 'terminalOpen:!1,terminalHeight:280,terminalIds:[]' 'e.terminalHeight>0?e.terminalHeight:280' 'isFinite(e)?e:280,n=' 'hi=360,gi=.7,_i=540,vi=360')PATCHED=( 'f={isOpen:!0,activeSurfaceId:null,surfaces:[]}' 'if( i.isOpen&&i.activeSurfaceId===null&&i.surfaces.length===0' 'Sd(e)}),Ed_=(0,Z.useEffect)(()=>{yr.terminalIds.length||Ed()},[vi,ri,ha]) ,Od=(0,Z.useCallback)' 'terminalOpen:!1,terminalHeight:180,terminalIds:[]' 'e.terminalHeight>0?e.terminalHeight:180' 'isFinite(e)?e:180,n=' 'hi=360,gi=.7,_i=360,vi=360')if [ "$#" -eq 0 ]; then echo "Usage: $0 [open] [minimum] | --revert"; exit 1; fienabled_groups=" "for group in "$@"; do case "$group" in open|minimum) enabled_groups+="$group " ;; --revert) ;; *) echo "Unknown group: $group"; echo "Usage: $0 [open] [minimum] | --revert"; exit 1 ;; esacdoneASAR="$(find_asar)"if [ -z "$ASAR" ] || [ ! -f "$ASAR" ]; then echo "app.asar not found. Run again with T3_ASAR=/path/to/resources/app.asar" exit 1fiecho "patching: $ASAR"SUDO=sudo[ -w "$ASAR" ] && SUDO=""escape_pattern() { printf '%s' "$1" | sed 's/[][\.*^$/]/\\&/g'; }escape_replacement() { printf '%s' "$1" | sed 's/[\/&]/\\&/g'; }sed_arguments=()expected=()for index in "${!CHANGE_GROUPS[@]}"; do if [[ "$enabled_groups" == *" ${CHANGE_GROUPS[$index]} "* ]]; then source_text="${ORIGINALS[$index]}"; target_text="${PATCHED[$index]}" else source_text="${PATCHED[$index]}"; target_text="${ORIGINALS[$index]}" fi sed_arguments+=(-e "s/$(escape_pattern "$source_text")/$(escape_replacement "$target_text")/") expected+=("$target_text")done$SUDO sed -i "${sed_arguments[@]}" "$ASAR"missing=0for index in "${!expected[@]}"; do label="${CHANGE_GROUPS[$index]}: ${expected[$index]:0:70}" if grep -aqF "${expected[$index]}" "$ASAR"; then echo "ok $label" else echo "MISSING $label" missing=1 fidoneif [ "$missing" -eq 1 ]; then echo "Some code changed in this T3 update: the patch needs to be reviewed." exit 1fiecho "Done. Quit and reopen T3."EOF
chmod +x ~/.local/bin/t3-patch-asar.sh
forrcin~/.bashrc ~/.zshrc;do
[ -f"$rc" ] ||continue
sed -i '/alias configt3chatafterupdate=/d'"$rc"echo"alias configt3chatafterupdate='~/.local/bin/t3-patch-asar.sh open minimum'">>"$rc"done~/.local/bin/t3-patch-asar.sh open minimum
Then quit and reopen T3.
After every T3 update
Open a new system terminal and run:
configt3chatafterupdate
To go back to T3's original defaults:
~/.local/bin/t3-patch-asar.sh --revert
Bonus: proactive panels
Not part of the patch, but it pairs well with it: Settings → Proactive panels opens the diff/PR panel automatically when there are changes ("proactivePanelsEnabled": true in ~/.t3/userdata/client-settings.json).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
The terminal drawer and the right panel are saved per thread. Every new thread starts with the hardcoded defaults:
Ctrl+J) closed, and 280px tall when opened (the minimum is 180px)Ctrl+Alt+B) closed, and 540px wide when opened (the minimum is 360px)If you always work with both open, you have to open (and resize) them again in every thread. There is no setting for this today.
Proposal
Any of these would solve it:
Related
Workaround (Linux, tested on T3 Code 0.0.45 .deb)
Until this exists, you can patch the bundled
app.asar. Every replacement keeps the same byte length, so no repacking is needed. Pick one option:openopen minimumHow it behaves:
Ctrl+J. If you close the drawer, it stays closed in that thread.Notes:
.deb,.rpmandtar.gzinstalls (it findsapp.asarnext to thet3codebinary). It does not work with the AppImage, because its files are read-only. If the script can't find your install, run it withT3_ASAR=/path/to/resources/app.asar.sudois only used whenapp.asarisn't writable by you (e.g./opt, owned by root). In that case run it from a system terminal, not from T3's own terminal: T3 runs with theno new privilegesflag, sosudofails inside it.~/.bashrcand~/.zshrc(whichever exist). Running the other option's block later switches the alias and the patch.app.asar, so the patch has to be applied again (see below).MISSINGfor each change it could not apply and exits with an error.Option A: terminal and right panel open by default (paste and apply)
Show command
Option B: terminal and right panel open by default, at their minimum size (paste and apply)
Show command
Then quit and reopen T3.
After every T3 update
Open a new system terminal and run:
To go back to T3's original defaults:
~/.local/bin/t3-patch-asar.sh --revertBonus: proactive panels
Not part of the patch, but it pairs well with it: Settings → Proactive panels opens the diff/PR panel automatically when there are changes (
"proactivePanelsEnabled": truein~/.t3/userdata/client-settings.json).All reactions