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
For security reasons it seem best to not use the legacy TIOCSTI. Please handle this internally or provide robust source-able shell configurations. hstr --show-[XXX]-config is almost good except that it is not reliably working.
I have tried several suggestions and none seems to work reliable. The one I am using currently works only with extra confirmation and has sometimes garbage in the output.
» cat ~/.bashrc.d/all/history
#!/usr/bin/env bash## History Commands
HISTFILESIZE=50000
shopt -s cmdhist
export HISTFILE=~/.cache/.bash_history # replace with /dev/nullexport HISTIGNORE="&:ls:exit:su*"# append to the history file, don't overwrite itshopt -s histappend
HISTCONTROL=ignoreboth # leading space hides commands from history & dupes are irgnored## hstr configurationalias hh=hstr # hh to be alias for hstrexport HSTR_CONFIG=hicolor # get more colorsexport HISTSIZE=${HISTFILESIZE}# increase history size (default is 500)# done in prompt file# ensure synchronization between Bash memory and history file#export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"
has_tiocsti="$(hstr --is-tiocsti)"if [[ "$has_tiocsti"=="y" ]];then# REQUIRES# sysctl -w dev.tty.legacy_tiocsti=1# sudo sh -c "echo 'dev.tty.legacy_tiocsti=1' > /etc/sysctl.d/9999-legacy-tiocsti.conf"if [[ $-=~ .*i.* ]];thenbind'"\C-r": "\C-a hstr -- \C-j"'bind'"\C-xk": "\C-a hstr -k \C-j"'bind -m vi-insert '"\C-r": "\C-u hstr -- \C-j"'bind -m vi '"\C-r": "ddi hstr -- \C-j"'fielse##TODO#hstr stops working on linux >=6.2.0 (depending on kernel config)#https://github.com/dvorka/hstr/issues/478##TODO ENDfunctionhstrnotiocsti {
{ READLINE_LINE="$( { </dev/tty hstr -- ${READLINE_LINE}; } 2>&11>&33>&- )"; } 3>&1;
READLINE_POINT=${#READLINE_LINE}
}
if [[ $-=~ .*i.* ]];thenbind -x '"\C-r": "hstrnotiocsti"'fiexport HSTR_TIOCSTI=n
fi
The text was updated successfully, but these errors were encountered:
Currently with bash 5.2.21 in gnome-terminal 3.50.1 (vte 0.74.1) on Arch Linux, kernel 6.6.3, with the output of hstr --show-configuration in the .bashrc file, that works without problems. The kernel is not compiled with CONFIG_LEGACY_TIOCSTI set and dev.tty.legacy_tiocsti is also not set.
Which OS and terminal are you using? What versions?
There are several issues concerning this problem: #478, #485, #486
The suggested bash snippets differ in all places:
For security reasons it seem best to not use the legacy TIOCSTI. Please handle this internally or provide robust source-able shell configurations.
hstr --show-[XXX]-config
is almost good except that it is not reliably working.I have tried several suggestions and none seems to work reliable. The one I am using currently works only with extra confirmation and has sometimes garbage in the output.
The text was updated successfully, but these errors were encountered: