Keybinding woes (esc + .)

Howdy all,

I’ve been banging my head against some keybinding issues that I’ve been having, specifically the use of “esc + .” on OSX. I’ve added the recommended:

export ATUIN_NOBIND="true"
eval "$(atuin init zsh)"

bindkey '^r' _atuin_search_widget

# depends on terminal mode
bindkey '^[[A' _atuin_search_widget
bindkey '^[OA' _atuin_search_widget

As per the docs, but I still cannot for the life of me figure out how to get that functionality back.

I have confirmed that if I don’t use Atuin at all, that things go back to normal and esc + . yanks the last word from the previous command. Does anyone have a hint to push me in the right direction? Many thanks.

Bumping for visibility. I still haven’t figured out what in Atuin is preventing the esc + . key combination from yanking the last word.

Do you know what this feature is called? I’ve not come across it before + cannot find anything online as all search engines expand to “escape characters”

There shouldn’t be anything preventing it, as we’re only adding some shell hooks + a keybinding really. I’m unable to replicate this on my setup too, as it still works for me on zsh with Atuin

Hi hi! It’s the same function as alt + . in Bash. I found this article: linux - Equivalent/Alternatives for Alt+Dot in Mac - Super User , which seems to be using the insert-last-argument bash function from readline.

I neglected to put in my environment information, which may also be helpful:

  • OS: Mac OS 14.3
  • Shell: zsh 5.9 (x86_64-apple-darwin23.0)
  • Additional info: Using Fig to manage plugins like Atuin, aliases, etc.
.zshrc
# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.pre.zsh"
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
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

#zmodload zsh/zprof
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
#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


# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME="powerlevel10k/powerlevel10k"
#ZSH_THEME="agnoster"
#POWERLEVEL9K_MODE="awesome-patched"

plugins=(git)

#ZSH Plugin Env Vars
#ZSH_TMUX_AUTOSTART="true"
#ZSH_TMUX_ITERM2="true"

# Custom Key Bindings
bindkey "^R" history-incremental-search-backward

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

autoload -Uz compinit
compinit

source $(brew --prefix)/opt/antidote/share/antidote/antidote.zsh

# initialize plugins statically with ${ZDOTDIR:-~}/.zsh_plugins.txt
antidote load

setopt clobber


# Golang specific stuff
export GOPATH=$HOME/go
export GO111MODULE=on

export CGO_CPPFLAGS="-Wno-error -Wno-nullability-completeness -Wno-expansion-to-defined"

#Using Z
. /opt/homebrew/etc/profile.d/z.sh

#Start tmux automatically
if [[ -z "$TMUX" ]] ;then
    ID="$( tmux ls | grep -vm1 attached | cut -d: -f1 )" # get the id f a deattached session
    if [[ -z "$ID" ]] ;then # if not available create a new one
        tmux new-session
    else
        tmux attach-session -t "$ID" # if available attach to it
    fi
fi

eval "$(direnv hook zsh)"

NPM_PACKAGES="${HOME}/.npm-packages"

export PATH="$PATH:$NPM_PACKAGES/bin"

# Preserve MANPATH if you already defined it somewhere in your config.
# Otherwise, fall back to `manpath` so we can inherit from `/etc/manpath`.
export MANPATH="${MANPATH-$(manpath)}:$NPM_PACKAGES/share/man"


# Enable iterm integration
source ~/.iterm2_shell_integration.zsh

# Ucomment below to enable zprof for profiling
#zprof

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

#ATUIN Stuff
#export ATUIN_NOBIND="true"
#eval "$(atuin init zsh)"
#
#bindkey '^r' _atuin_search_widget
#
## depends on terminal mode
#bindkey '^[[A' _atuin_search_widget
#bindkey '^[OA' _atuin_search_widget

# Fig post block. Keep at the bottom of this file.
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh"

I’m making the assumption that I just need to set a specific key binding to get around this, but I’m not 100% sure if that’s the recommended path to take.

Actually, I’m going to close this out. I was digging back into Fig’s config today only to find that they EOL’d it in favor of AWS codewhisperer. Reverting to vanilla Zsh works just fine.

1 Like

ah I see! glad you got it sorted :pray: