Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running as root doesn't make you double-enter the choice without TIOCSTI #507

Open
mooreye opened this issue Jan 3, 2024 · 0 comments
Open

Comments

@mooreye
Copy link

mooreye commented Jan 3, 2024

I have the following in .bashrc:

if [[ $- == *i* ]]; then
    _hstrnotiocsti() {
        { READLINE_LINE="$( { </dev/tty hstr "${@:-}" $READLINE_LINE; } 2>&1 1>&3 3>&- )"; } 3>&1
        READLINE_POINT=${#READLINE_LINE}
    }
    export HSTR_TIOCSTI=n
    export HSTR_CONFIG='blacklist,hicolor,help-on-opposite-side,raw-history-view,static-favorites'
    export HSTR_PROMPT='> '
    bind -x '"\C-r": _hstrnotiocsti --'
    bind -x '"\C-s": _hstrnotiocsti -f'
fi

For every user other than root, I have to confirm selection by pressing Enter the second time to actually invoke a command from history that appears in the command line. With root however, the command gets executed instantly. How to replicate the non-root user behavior on root?

@dvorka dvorka self-assigned this Feb 24, 2024
@dvorka dvorka added this to the 3.1 TIOCSTI strikes back! milestone Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants