Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
2
votes
1
answers
212
views
`type` command ignores `LANG` after upgrading to `bash` 5.3 on iTerm2/macOS
I'm on macOS and I set English as the locale except for `LC_TIME`: ```bash ~ $ locale LANG="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_CTYPE="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="ja_JP.UTF-8" LC_ALL= ``` Previously, the output of `type` com...
I'm on macOS and I set English as the locale except for
LC_TIME
:
~ $ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_ALL=
Previously, the output of type
command was (naturally) English:
$ type bash
bash is /opt/homebrew/bin/bash
However, after upgrading to bash
5.3, the output is now in Japanese:
~ $ bash --version
GNU bash, version 5.3.0(1)-release (aarch64-apple-darwin24.4.0)
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
~ $ type bash
bash は /opt/homebrew/bin/bash です
Why?
---
By the way, I also have a very surprising result.
type
command seems NOT to be stateless. Specifically, it seems the command *remember*s the last environment in which it was previously executed:
~ $ echo $LANG
en_US.UTF-8
# The output is in Japanese.
~ $ type bash
bash は /opt/homebrew/bin/bash です
# When I override $LANG
, the output is in English.
~ $ LANG= type bash
bash is /opt/homebrew/bin/bash
# As I used *simple command* in bash
,
# the value of $LANG
is still en_US.UTF-8
.
~ $ echo $LANG
en_US.UTF-8
# Now, surprisingly, type
outputs in English.
~ $ type bash
bash is /opt/homebrew/bin/bash
---
Current workaround is to use /usr/bin/type
instead of the shell builtin type
:
~ $ builtin type bash
bash は /opt/homebrew/bin/bash です
~ $ /usr/bin/type bash
bash is /opt/homebrew/bin/bash
---
Output of typeset -p | grep -e LC_ -e LANG
(requested by a comment):
~ $ typeset -p | grep -e LC_ -e LANG
declare -x LANG="en_US.UTF-8"
declare -x LC_TERMINAL="iTerm2"
declare -x LC_TERMINAL_VERSION="3.5.14"
declare -x LC_TIME="ja_JP.UTF-8"
ynn
(998 rep)
Jul 8, 2025, 01:09 AM
• Last activity: Jul 8, 2025, 08:42 AM
0
votes
0
answers
82
views
Iterm2 command history truncates long commands
When I try to apply my last command on iterm2, and that command is a bit longer than 1 line, the command history only saves part of the command, making the history feature useless to me. How can I configure iterm2 to save the entire command I last executed, so I can use it again, despite its size?
When I try to apply my last command on iterm2, and that command is a bit longer than 1 line, the command history only saves part of the command, making the history feature useless to me.
How can I configure iterm2 to save the entire command I last executed, so I can use it again, despite its size?
mFeinstein
(613 rep)
Sep 23, 2024, 04:32 AM
-1
votes
1
answers
250
views
iTerm2 color scheme: use alternative background color (41m)
I have set up iTerm2 to change its profile when I ssh to a specific machine. This works as intended (I am using `zsh` and `oh-my-zsh`). The main thing I do for this is in my `~/.zshrc` file: echo -e "\033]1337;SetProfile= \a" This sets the colors as defined in "Colors" in iTerm2's "Profile". So far,...
I have set up iTerm2 to change its profile when I ssh to a specific machine. This works as intended (I am using
zsh
and oh-my-zsh
).
The main thing I do for this is in my ~/.zshrc
file:
echo -e "\033]1337;SetProfile=\a"
This sets the colors as defined in "Colors" in iTerm2's "Profile". So far, so good.
I have downloaded the [color profile called "Harper"](https://iterm2colorschemes.com/) and would like to use it with the "41m column" (in lack of a better term). As far as I understand that basically means I have to set the terminal's background color to "red" (which is what "41m" means).
But I cannot figure out how to do this...
I have tried (for example):
echo -e "\033]1337;SetProfile=\a"
echo -e "\033]1337;SetColors=bg=c00\a"
or
echo -e "\033]1337;SetProfile=\a"
echo -e "\033]1337;SetColors=bg=f00\a"
Which makes iTerm show a red background and use (for example) the foreground colors defined in the Harper color scheme. But that's not what I want.
My question is very similar to (not to say the same) what was asked in a Stackoverflow question: [Iterm2 colors - using the 42m or 41m options](https://stackoverflow.com/q/34257198) . But that question does not have an answer.
By the way, I know that most instructions on the Internet seem to use a different OSC command (50 instead of 1337), but according to [iTerm2's documentation](https://iterm2.com/documentation-escape-codes.html) , that is outdated:
> The OSC command 50 used to be used but it conflicts with xterm, so it is now 1337.
Is it even possible to do what I intend?
Andreas
(1 rep)
Jan 15, 2024, 04:11 PM
• Last activity: Jan 18, 2024, 12:26 PM
1
votes
1
answers
169
views
In vim: stop SHIFT+SPACE from discarding all unsaved changes
Every time I type Shift + Space in `vim`, it undoes all changes to the file that have not yet been written. I would like this to not happen, as it is extremely easy to press Shift + Space by accident. I am using iTerm2, and am ssh'ed into a remote machine. When I use vim (in iTerm2) on my local (OSX...
Every time I type Shift+Space in
vim
, it undoes all changes to the file that have not yet been written. I would like this to not happen, as it is extremely easy to press Shift+Space by accident.
I am using iTerm2, and am ssh'ed into a remote machine. When I use vim (in iTerm2) on my local (OSX) machine, this issue does not occur. When I use the default terminal instead of iTerm2, this does not occur, even when ssh'ed into the same system. So: only the combination of iTerm2 + being in an ssh session seems to cause problems.
I have never modified any vim keybindings; I have no ~/.vimrc
, and :verbose Map
doesn't show any binding. This makes me think this is an iTerm2 issue - but I don't understand why it would not cause this problem when running a shell on my local machine. Are there any iTerm2 profile settings that apply only in ssh? Or should I look elsewhere for this issue?
Peter
(11 rep)
Sep 14, 2023, 06:04 PM
• Last activity: Sep 19, 2023, 07:14 PM
0
votes
1
answers
376
views
Double zsh prompt is showing unformatted then formatted
Any command I run (aside from `clear`) results in a double zsh prompt -- the first one showing the unformatted prompt, the second one showing the correct, formatted prompt. [![enter image description here][1]][1] [1]: https://i.sstatic.net/mdQgf.png My `~/.zshrc` file: ``` if [[ -r "${XDG_CACHE_HOME...
Any command I run (aside from
My
clear
) results in a double zsh prompt -- the first one showing the unformatted prompt, the second one showing the correct, formatted prompt.

~/.zshrc
file:
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="agnoster"
zstyle ':omz:update' mode auto # update automatically without asking
ENABLE_CORRECTION="true"
COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
HIST_STAMPS="mm/dd/yyyy"
plugins=(
zsh-completions
git
pip
jsontools
dotenv
)
source ~/powerlevel10k/powerlevel10k.zsh-theme
# To customize prompt, run p10k configure
or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
export FZF_DEFAULT_OPTS='-height=40% -preview="cat {}" -preview-window=right:60%:wrap'
alias ip="ipconfig getifaddr en0"
alias zshconf="vim ~/.zshrc"
alias szsh="source ~/.zshrc"
alias ohmyzsh="cd ~/.oh-my-zsh"
alias gs="git status"
alias gac="git add . && git commit -am"
alias gb="git branch --show-current"
alias goof="git add --all && git commit --amend --no-edit"
alias ff="find . | grep "
alias ft="grep -lrni -e "
alias rando="openssl rand -base64 24"
fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
source $ZSH/oh-my-zsh.sh
[[ -s "/Users//.gvm/scripts/gvm" ]] && source "/Users//.gvm/scripts/gvm"
Any help is appreciated. Thanks!
Output from command: typeset -p PS1 RPS1; typeset -fp precmd preexec $precmd_functions $preexec_functions
typeset PS1=$'${$((_p9k_on_expand()))+}%{${_p9k__raw_msg-}${_p9k__raw_msg::=}%}${(e)_p9k_t}${_p9k__1-${${:-${_p9k__d::=0}${_p9k__rprompt::=${_p9k__1r-${${:-${_p9k__bg::=NONE}${_p9k__i::=0}${_p9k__sss::=${(Q)${:-"%\\\\{%\\\\}"}}}}+}${${:-"${${(%):-%j}:#0}"}:+${${:-${P9K_CONTENT::=""}${_p9k__n::=}${${${_p9k__bg:-0}:#NONE}:-${_p9k__n::=12}}${_p9k__n:=${${(M)${:-x$_p9k__bg}:#x(000|000)}:+14}}${_p9k__n:=15}${_p9k__v::=}${_p9k__c::="${P9K_CONTENT}"}${_p9k__c::=${_p9k__c//\C-M}}${_p9k__e::=${${_p9k__1rbackground_jobs+00}:-${${(%):-$_p9k__c%1(l.1.0)}[-1]}1}}}+}${${_p9k__e:#00}:+${_p9k_t[$_p9k__n]//$_p9k__w}${_p9k__c}%b%K{000\\}%F{006\\}${${(M)_p9k__e:#11}:+ }$_p9k__v${${:-${_p9k__w::=%b%K{000\\}%F{006\\} %b%K{000\\}%F{006\\}}${_p9k__sss::=%b%K{000\\}%F{006\\} %k%F{000\\}%b%K{000\\}%F{006\\}}${_p9k__i::=3}${_p9k__bg::=000}}+}}}${${:-"${${:-$_p9k__keymap.$_p9k__zle_state}:#(vicmd.*|vivis.*|vivli.*|*.*insert*)}"}:+${${:-${P9K_CONTENT::=OVERTYPE}${_p9k__n::=}${${${_p9k__bg:-0}:#NONE}:-${_p9k__n::=28}}${_p9k__n:=${${(M)${:-x$_p9k__bg}:#x(003|003)}:+30}}${_p9k__n:=31}${_p9k__c::="${P9K_CONTENT}"}${_p9k__c::=${_p9k__c//\C-M}}${_p9k__e::=${${_p9k__1rvi_mode+00}:-${${(%):-$_p9k__c%1(l.1.0)}[-1]}0}}}+}${${_p9k__e:#00}:+${_p9k_t[$_p9k__n]//$_p9k__w}${_p9k__c}%b%K{003\\}%F{000\\}${${:-${_p9k__w::=%b%K{003\\}%F{000\\} %b%K{003\\}%F{000\\}}${_p9k__sss::=%b%K{003\\}%F{000\\} %k%F{003\\}%b%K{003\\}%F{000\\}}${_p9k__i::=41}${_p9k__bg::=003}}+}}}${${:-"${(M)${:-$_p9k__keymap$_p9k__region_active}:#vicmd0}"}:+${${:-${P9K_CONTENT::=NORMAL}${_p9k__n::=}${${${_p9k__bg:-0}:#NONE}:-${_p9k__n::=32}}${_p9k__n:=${${(M)${:-x$_p9k__bg}:#x(002|002)}:+34}}${_p9k__n:=35}${_p9k__c::="${P9K_CONTENT}"}${_p9k__c::=${_p9k__c//\C-M}}${_p9k__e::=${${_p9k__1rvi_mode+00}:-${${(%):-$_p9k__c%1(l.1.0)}[-1]}0}}}+}${${_p9k__e:#00}:+${_p9k_t[$_p9k__n]//$_p9k__w}${_p9k__c}%b%K{002\\}%F{000\\}${${:-${_p9k__w::=%b%K{002\\}%F{000\\} %b%K{002\\}%F{000\\}}${_p9k__sss::=%b%K{002\\}%F{000\\} %k%F{002\\}%b%K{002\\}%F{000\\}}${_p9k__i::=41}${_p9k__bg::=002}}+}}}${${:-"${(M)${:-$_p9k__keymap$_p9k__region_active}:#(vicmd1|vivis?|vivli?)}"}:+${${:-${P9K_CONTENT::=VISUAL}${_p9k__n::=}${${${_p9k__bg:-0}:#NONE}:-${_p9k__n::=36}}${_p9k__n:=${${(M)${:-x$_p9k__bg}:#x(004|004)}:+38}}${_p9k__n:=39}${_p9k__c::="${P9K_CONTENT}"}${_p9k__c::=${_p9k__c//\C-M}}${_p9k__e::=${${_p9k__1rvi_mode+00}:-${${(%):-$_p9k__c%1(l.1.0)}[-1]}0}}}+}${${_p9k__e:#00}:+${_p9k_t[$_p9k__n]//$_p9k__w}${_p9k__c}%b%K{004\\}%F{000\\}${${:-${_p9k__w::=%b%K{004\\}%F{000\\} %b%K{004\\}%F{000\\}}${_p9k__sss::=%b%K{004\\}%F{000\\} %k%F{004\\}%b%K{004\\}%F{000\\}}${_p9k__i::=41}${_p9k__bg::=004}}+}}}${${:-${P9K_CONTENT::=08:53:09 AM}${_p9k__n::=}${${${_p9k__bg:-0}:#NONE}:-${_p9k__n::=40}}${_p9k__n:=${${(M)${:-x$_p9k__bg}:#x(007|007)}:+42}}${_p9k__n:=43}${_p9k__v::=}${_p9k__c::="${P9K_CONTENT}"}${_p9k__c::=${_p9k__c//\C-M}}${_p9k__e::=${${_p9k__1rtime+00}:-${${(%):-$_p9k__c%1(l.1.0)}[-1]}1}}}+}${${_p9k__e:#00}:+${_p9k_t[$_p9k__n]//$_p9k__w}at ${_p9k__c}%b%K{007\\}%F{000\\}${${(M)_p9k__e:#11}:+ }$_p9k__v${${:-${_p9k__w::=%b%K{007\\}%F{000\\} %b%K{007\\}%F{000\\}}${_p9k__sss::=%b%K{007\\}%F{000\\} %k%F{007\\}%b%K{007\\}%F{000\\}}${_p9k__i::=46}${_p9k__bg::=007}}+}}$_p9k__sss%b%k%f}}${_p9k__lprompt::=${_p9k__1l_frame-"%240F╭─"}${_p9k__1l-${${:-${_p9k__bg::=NONE}${_p9k__i::=0}${_p9k__sss::=%f}}+}${${:-${P9K_CONTENT::=}${_p9k__n::=}${${${_p9k__bg:-0}:#NONE}:-${_p9k__n::=44}}${_p9k__n:=${${(M)${:-x007}:#x($_p9k__bg|${_p9k__bg:-0})}:+46}}${_p9k__n:=47}${_p9k__c::="${P9K_CONTENT}"}${_p9k__c::=${_p9k__c//\C-M}}${_p9k__e::=${${_p9k__1los_icon+00}:-${${(%):-$_p9k__c%1(l.1.0)}[-1]}0}}}+}${${_p9k__e:#00}:+${${_p9k_t[$_p9k__n]//$_p9k__ss}//$_p9k__s}${_p9k__c}%b%K{007\\}%F{232\\} ${${:-${_p9k__s::=%F{007\\}}${_p9k__ss::=}${_p9k__sss::=%F{007\\}}${_p9k__i::=1}${_p9k__bg::=007}}+}}${(e)_p9k__vcs}%b%k$_p9k__sss%b%k%f}}}+}${(e)_p9k_t}${_p9k__lprompt}${${_p9k__g+\n}:-${:-"%F{240}"}${${${_p9k__m:#-*}:+${${_p9k__1g+${(pl.$((_p9k__m+1)).. .)}}:-${(pl.$((_p9k__m+1))..─.)}}$_p9k__rprompt${_p9k_t[$((1+!_p9k__ind))]}}:-\n}%b%k%f}}${_p9k__2-${_p9k__2l_frame-"%240F╰─"}${_p9k__2l-${${:-${_p9k__bg::=NONE}${_p9k__i::=0}${_p9k__sss::=%f}}+}%b%k$_p9k__sss%b%k%f${:-" %b%k%f"}}}${${COLUMNS::=$_p9k__clm}+}'
_p9k_do_nothing () {
true
}
_zsh_autosuggest_start () {
if (( ${+ZSH_AUTOSUGGEST_MANUAL_REBIND} ))
then
add-zsh-hook -d precmd _zsh_autosuggest_start
fi
_zsh_autosuggest_bind_widgets
}
omz_termsupport_precmd () {
[[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return
title "$ZSH_THEME_TERM_TAB_TITLE_IDLE" "$ZSH_THEME_TERM_TITLE_IDLE"
}
omz_termsupport_cwd () {
local URL_HOST URL_PATH
URL_HOST="$(omz_urlencode -P $HOST)" || return 1
URL_PATH="$(omz_urlencode -P $PWD)" || return 1
[[ -z "$KONSOLE_VERSION" ]] || URL_HOST=""
printf "\e]7;file://%s%s\e\\" "${URL_HOST}" "${URL_PATH}"
}
_p9k_precmd () {
__p9k_new_status=$?
__p9k_new_pipestatus=($pipestatus)
trap ":" INT
[[ -o ksh_arrays ]] && __p9k_ksh_arrays=1 || __p9k_ksh_arrays=0
[[ -o sh_glob ]] && __p9k_sh_glob=1 || __p9k_sh_glob=0
_p9k_restore_special_params
_p9k_precmd_impl
[[ ${+__p9k_instant_prompt_active} == 0 || -o no_prompt_cr ]] || __p9k_instant_prompt_active=2
setopt no_local_options no_prompt_bang prompt_percent prompt_subst prompt_cr prompt_sp
typeset -g __p9k_trapint='_p9k_trapint; return 130'
trap "$__p9k_trapint" INT
: ${(%):-%b%k%s%u}
}
_p9k_preexec1 () {
_p9k_restore_special_params
unset __p9k_trapint
trap - INT
}
omz_termsupport_preexec () {
[[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return
emulate -L zsh
setopt extended_glob
local -a cmdargs
cmdargs=("${(z)2}")
if [[ "${cmdargs
}" = fg ]]
then
local job_id jobspec="${cmdargs#%}"
case "$jobspec" in
() job_id=${jobspec} ;;
("" | % | +) job_id=${(k)jobstates[(r)*:+:*]} ;;
(-) job_id=${(k)jobstates[(r)*:-:*]} ;;
([?]*) job_id=${(k)jobtexts[(r)*${(Q)jobspec}*]} ;;
(*) job_id=${(k)jobtexts[(r)${(Q)jobspec}*]} ;;
esac
if [[ -n "${jobtexts[$job_id]}" ]]
then
1="${jobtexts[$job_id]}"
2="${jobtexts[$job_id]}"
fi
fi
local CMD="${1[(wr)^(*=*|sudo|ssh|mosh|rake|-*)]:gs/%/%%}"
local LINE="${2:gs/%/%%}"
title "$CMD" "%100>...>${LINE}%<<"
}
_p9k_preexec2 () {
typeset -g _p9k__preexec_cmd=$2
_p9k__timer_start=EPOCHREALTIME
P9K_TTY=old
(( ! $+_p9k__iterm_cmd )) || _p9k_iterm2_preexec
}
joon_bug
(11 rep)
Aug 28, 2023, 10:12 PM
• Last activity: Aug 30, 2023, 06:59 PM
2
votes
0
answers
164
views
How to systematically troubleshoot a broken gnu-screen installation?
I recently started to work in a shared Linux cluster that a version of gnu-screen that I consider unacceptably old (4.01, from 2006). I was not able to convince the system's administrators to install a more recent version of gnu-screen, so I installed my own off my home directory, using `conda`. Unf...
I recently started to work in a shared Linux cluster that a version of gnu-screen that I consider unacceptably old (4.01, from 2006).
I was not able to convince the system's administrators to install a more recent version of gnu-screen, so I installed my own off my home directory, using
conda
.
Unfortunately, even after I installed my long-trusted ~/.screenrc
file, my conda
-installed instance of gnu-screen does not work well at all.
For example, the backspace key does not erase the character to the left of the cursor; instead, it behaves like the space key, at least as far as what shows up on the screen. Hitting the C-r
key, which I use *all the time* to search my history, disfigures my screen grotesquely. Other than gnu-screen's "command key" (which I have set to C-h
), pretty much any chord involving Ctrl is messed up. Etc.
I should emphasize that all these problems emerge only after I start a new gnu-screen
session, using my conda
-installed instance of gnu-screen
. Outside of screen, or when I use the ancient /usr/bin/screen
, my terminal behaves normally.
Still, I suspect that the problem may have something to do with my TERM
variable's setting at the time of invoking screen
(namely TERM=xterm-256color
), and/or the terminal emulator I am using (iTerm2 running on OS X), but I don't know how to go beyond these hunches.
When I search online for solutions to this problem I come across massive amounts of trial-and-error.
Is there a systematic, reasonable way to troubleshoot this problem?
kjo
(16299 rep)
Feb 23, 2023, 05:46 PM
• Last activity: Feb 25, 2023, 02:33 PM
1
votes
1
answers
532
views
iTerm2 - Deleting an entire word until whitespace
I have my iTerm2 configured with a shortcut to delete a word (keyboard mapping of Hex code 0x17). However, I want it to delete until reaching a whitespace: Current: `cd hello-world` -> `cd hello-` Wanted: `cd hello-world` -> `cd ` Is there a way to configure the non-word separators somehow? Or to ac...
I have my iTerm2 configured with a shortcut to delete a word (keyboard mapping of Hex code 0x17).
However, I want it to delete until reaching a whitespace:
Current:
cd hello-world
-> cd hello-
Wanted:
cd hello-world
-> cd
Is there a way to configure the non-word separators somehow? Or to achieve this by other means?
Yaron Budowski
(131 rep)
Jan 29, 2023, 02:49 PM
• Last activity: Jan 29, 2023, 09:07 PM
0
votes
1
answers
965
views
My iTerm2 prompt is showing my username @ 192 and not my machine name... why?
Why would my iTerm2 command prompt change to `user@192` instead of my machine name? And how do I prevent it from changing to `user@192`?
Why would my iTerm2 command prompt change to
user@192
instead of my machine name? And how do I prevent it from changing to user@192
?
LaDul_FSDMex
(1 rep)
Feb 3, 2022, 10:49 PM
• Last activity: Dec 23, 2022, 11:21 PM
0
votes
1
answers
976
views
ncurses applications not working in iTerm2
I cannot get commandline tools that use ncurses to work in iTerm2. They either fail or fall-back to some other UI if they have it (e.g. text only). Example for [VLC][1] (installed via Homebrew): ``` % /Applications/VLC.app/Contents/MacOS/VLC -I ncurses VLC media player 3.0.16 Vetinari (revision 3.0....
I cannot get commandline tools that use ncurses to work in iTerm2. They either fail or fall-back to some other UI if they have it (e.g. text only).
Example for VLC (installed via Homebrew):
% /Applications/VLC.app/Contents/MacOS/VLC -I ncurses
VLC media player 3.0.16 Vetinari (revision 3.0.16-0-g5e70837d8d)
Error opening terminal: xterm-256color.
I have tried with different values for the TERM
(xterm, rxvt, vt100) env variable and got the same error.
More details about the iTerm2 session settings:
% env | grep -i term
LC_TERMINAL_VERSION=3.4.9beta1
ITERM_PROFILE=Default
__CFBundleIdentifier=com.googlecode.iterm2
TERM_PROGRAM_VERSION=3.4.9beta1
TERM_PROGRAM=iTerm.app
LC_TERMINAL=iTerm2
COLORTERM=truecolor
TERM=xterm-256color
Worth mentioning that this is only happening in an M1 MacBook Pro running macOS BigSur 11.5. With the same iTerm settings ncurses apps work fine in an Intel Macbook Pro running the same OS version.
scetoaux
(101 rep)
Aug 2, 2021, 12:12 PM
• Last activity: Nov 1, 2022, 10:15 AM
0
votes
1
answers
382
views
iterm2 - vim is printing line numbers while scrolling
In iterm2, while scrolling in the vim I see a strange behavior. Whenever I am scrolling it is printing line number with scrolling. How to overcome from this behavior call-hometic_scale_1.txt" 3248L, 118730C 45,1 Top 46,1 0% contact smart-licensing 47,1 0% profile ZnscoTAC-1 48,1 0% active 49,1 0% de...
In iterm2, while scrolling in the vim I see a strange behavior. Whenever I am scrolling it is printing line number with scrolling. How to overcome from this behavior
call-hometic_scale_1.txt" 3248L, 118730C 45,1 Top
46,1 0%
contact smart-licensing 47,1 0%
profile ZnscoTAC-1 48,1 0%
active 49,1 0%
destination transport-method http 50,1 0%
! 51,1 0%
! 52,1 0%
hw-module profile npu native-mode-enable 53,1 0%
vivek
(131 rep)
Jul 23, 2020, 07:59 AM
• Last activity: Aug 18, 2022, 12:56 PM
1
votes
0
answers
1582
views
new tmux pane not sourcing zshrc file
Using iTerm2 with tmux and zsh. I have an issue that new tmux panes doesn't source `~/.zshrc` file I have customized my terminal (when running `source ~/.zshrc` manually it works) but when opening new pane (`C+b` and `c`) it doesn't source the file `~/.tmux.conf` ``` set -g default-terminal "screen-...
Using iTerm2 with tmux and zsh. I have an issue that new tmux panes doesn't source
]
current terminal (on new pane)
wanted terminal (on new pane)
~/.zshrc
file
I have customized my terminal (when running source ~/.zshrc
manually it works) but when opening new pane (C+b
and c
) it doesn't source the file
~/.tmux.conf
set -g default-terminal "screen-256color"
set -g default-command /bin/zsh
set-option -g default-shell /bin/zsh
~/.zshrc
export ZSH="$HOME/.oh-my-zsh"
plugins=(git tmux)
ZSH_TMUX_AUTOSTART=true
source $ZSH/oh-my-zsh.sh
if [[ -n $SSH_CONNECTION ]]; then
export EDITOR='vim'
else
export EDITOR='mvim'
fi
export TERM=xterm-256color
eval "$(starship init zsh)"
iTerm settings
[



Eyal Solomon
(111 rep)
Jul 18, 2022, 07:13 AM
0
votes
1
answers
62
views
On macOS, how do I clear the previous bad returns in iTerm2?
I want to permanently clear the bad returns in iTerm2. I have used "Clear" and "command-k" etc including with "l" shortcuts but it apparently only clears the current terminal. If I restart the terminal, the bad returns appear at the beginning. How can I clear them permanently?[
user533628
Jul 13, 2022, 07:23 PM
• Last activity: Jul 13, 2022, 08:18 PM
22
votes
2
answers
4900
views
Ctrl + U deletes whole line regardless of cursor position
I am learning terminal tips. In [this][1] tutorial, the guy says that Ctrl + U deletes everything from the cursor until the end of line. In my case, it always deletes the whole line. I am using `zsh` on macOS. [1]: https://www.youtube.com/watch?v=V8EUdia_kOE
I am learning terminal tips. In this tutorial, the guy says that Ctrl + U deletes everything from the cursor until the end of line. In my case, it always deletes the whole line. I am using
zsh
on macOS.
Jack Thomson
(491 rep)
Jun 3, 2019, 05:54 PM
• Last activity: May 23, 2022, 05:20 PM
2
votes
0
answers
108
views
Byobu (tmux backend) after copying text in scrollback mode automatically quits scrollback mode
To clarify, "automatically quits scrollback" mode means byobu goes into normal mode and jumps to the bottom, and I can't just go back to the point I previously scrolled up to. I am also using iterm2 and use mouse (set in .tmux.conf) to enter scrollback mode, not sure how it affects the configuration...
To clarify, "automatically quits scrollback" mode means byobu goes into normal mode and jumps to the bottom, and I can't just go back to the point I previously scrolled up to.
I am also using iterm2 and use mouse (set in .tmux.conf) to enter scrollback mode, not sure how it affects the configurations.
Aethan
(21 rep)
Apr 17, 2022, 04:59 PM
3
votes
2
answers
4555
views
How to use regex negative lookahead?
I'm trying to use iTerm2 profile triggers on my mac to change the prompt if I leave my home directory. This rule should only apply when the node I'm on has a hostname of `headnode`. The prompt will also include the machine's location in parenthesis after the hostname. I'm trying to build a regex tha...
I'm trying to use iTerm2 profile triggers on my mac to change the prompt if I leave my home directory. This rule should only apply when the node I'm on has a hostname of
headnode
. The prompt will also include the machine's location in parenthesis after the hostname. I'm trying to build a regex that will match any directory unless it includes ~
.
So it should match:
[jbutryn@headnode (us-west-a) /]$
but not:
[jbutryn@headnode (us-west-a) ~]$
or
[jbutryn@headnode (us-west-a) ~/tmp]$
etc.
Currently I'm building my regex like this:
\[.*\@headnode.*(?!\~).*].
But that matches all examples above. Does anyone know what I'm doing wrong? Thanks!
jesse_b
(41447 rep)
Aug 9, 2017, 03:48 PM
• Last activity: Jan 19, 2022, 05:48 PM
2
votes
0
answers
142
views
Prevent the line `load:... cmd:... running ...` upon SIGINFO
Issuing SIGINFO (e.g. by pressing ^T) while a terminal process is running usually results in a printout of a line ``` load: 2.93 cmd: sleep 7826 waiting 0.00u 0.00s ``` If I have written the tool that's running, I can make it catch the signal SIGINFO and react to it (e.g., by printout of certain inf...
Issuing SIGINFO (e.g. by pressing ^T) while a terminal process is running usually results in a printout of a line
load: 2.93 cmd: sleep 7826 waiting 0.00u 0.00s
If I have written the tool that's running, I can make it catch the signal SIGINFO and react to it (e.g., by printout of certain information, like dd
or ping
are known to do). However, the above line is printed nevertheless. I wonder who is responsible for its being printed, and if it is possible to suppress it.
FYI: I'm using zsh inside iTerm2 on MacOS.
Bubaya
(141 rep)
Jan 13, 2022, 03:42 PM
• Last activity: Jan 13, 2022, 05:11 PM
0
votes
2
answers
1760
views
How can I launch a new session of tmux in iTerm2 on a separate window?
I would like to start a tmux session on a separate window in iTerm2. Now I'm writing my own configuration script to launch the session. tmux new-session -s dev -n main -d tmux send-keys -t dev "cd $DL" C-m tmux split-window -h -t dev tmux split-window -v -t dev -p 30 tmux resize-pane -x 70 -y 20 tmu...
I would like to start a tmux session on a separate window in iTerm2. Now I'm writing my own configuration script to launch the session.
tmux new-session -s dev -n main -d
tmux send-keys -t dev "cd $DL" C-m
tmux split-window -h -t dev
tmux split-window -v -t dev -p 30
tmux resize-pane -x 70 -y 20
tmux attach -t dev
This starts a new session but the window is on the window I execute the script, not the new, separate window in iTerm2.
So I changed the first line (
tmux new-session -s dev -n main -d
) to tmux -CC new -t dev
, but then although the session starts in a new window, it does not have the split and the resize. It seems to only open the new session in a new window and that's all.
How can I make it launched in a new window with all the initial settings including the directory change, split window, etc...?
Blaszard
(369 rep)
Jul 4, 2018, 08:51 PM
• Last activity: Jan 8, 2022, 02:52 AM
2
votes
1
answers
1228
views
How to disable iTerm2 tmux integration
iTerm2 runs slowly when using `tmux` (without `-CC` control mode integration). It is clearly designed with the intention of using `-CC`. However, I don't like the desktop window management of tmux windows/panes. I want tmux keyboard shortcuts and everything in a single iTerm2 window. Is there a way...
iTerm2 runs slowly when using
tmux
(without -CC
control mode integration). It is clearly designed with the intention of using -CC
.
However, I don't like the desktop window management of tmux windows/panes. I want tmux keyboard shortcuts and everything in a single iTerm2 window.
Is there a way to disable tmux integration in iTerm2 so that I can tmux
without using -CC
? And so that it won't lag?
If you are having difficulty trying to reproduce, try opening 2 tabs attached to the same tmux session. Compare it's I/O performance to the system terminal attached to the same tmux session.
P H Kaznowski
(129 rep)
Nov 20, 2021, 04:01 PM
• Last activity: Nov 21, 2021, 06:48 PM
1
votes
1
answers
1323
views
Terminal output looking weird
I just got a new macOS system, and the output text in the terminal is not properly formatted. Every line is indented every time a newline is printed, instead of "on top" of each other so it ends up looking like a waterfall of words. I am using iTerm2. This happens no matter which shell I use. Anyone...
I just got a new macOS system, and the output text in the terminal is not properly formatted.
Every line is indented every time a newline is printed, instead of "on top" of each other so it ends up looking like a waterfall of words.
I am using iTerm2.
This happens no matter which shell I use.
Anyone know what I can do to fix this?

Wenger
(11 rep)
Oct 13, 2021, 10:19 AM
• Last activity: Oct 13, 2021, 11:45 AM
2
votes
1
answers
531
views
MacOS/iTerm2/fish arrow keys stops working after terminating a process with ctrl+c
I am using iTerm2 on my mac pro, and using fish as my shell. Every time I have a process running and I break it by pressing ctrl+c, the arrow keys stops working after and starts emitting ^[[A etc. Attached a screenshot to my iTerm2 preferences > Profiles [Default] > Terminal [![enter image descripti...
I am using iTerm2 on my mac pro, and using fish as my shell. Every time I have a process running and I break it by pressing ctrl+c, the arrow keys stops working after and starts emitting ^[[A etc.
Attached a screenshot to my iTerm2 preferences > Profiles [Default] > Terminal

Bishoy
(183 rep)
Sep 15, 2021, 02:13 AM
• Last activity: Sep 15, 2021, 08:30 AM
Showing page 1 of 20 total questions