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

Unexpected "preexec" characters with every output in Fedora 35 #116

Closed
moneroexamples opened this issue Feb 5, 2022 · 5 comments
Closed

Comments

@moneroexamples
Copy link

When echoing anything I'm getting strange output:

�]777;preexec�

image

This seems to be caused by the following lines in /etc/profile.d/vte.sh:

if [[ -n "${BASH_VERSION:-}" ]]; then

    # Newer bash versions support PROMPT_COMMAND as an array. In this case
    # only add the __vte_osc7 function to it, and leave setting the terminal
    # title to the outside setup.
    # On older bash, we can only overwrite the whole PROMPT_COMMAND, so must
    # use the __vte_prompt_command function which also sets the title.

    if [[ "$(declare -p PROMPT_COMMAND 2>&1)" =~ "declare -a" ]]; then
        PROMPT_COMMAND+=(__vte_osc7) && PS0=$(printf "\033]777;preexec\033\\")
    else
        PROMPT_COMMAND="__vte_prompt_command" && PS0=$(printf "\033]777;preexec\033\\")
    fi

elif [[ -n "${ZSH_VERSION:-}" ]]; then
    precmd_functions+=(__vte_osc7)
fi

Commenting out the entire code above and adding bind 'set enable-bracketed-paste off' seems to fix the issue:

image

Related to #115 and #107

@gsauthof
Copy link

gsauthof commented Jul 3, 2022

FWIW, I'm also on Fedora 35, and I'm only affected by #107.

That means even with /etc/profile.d/vte.sh I can't reproduce this issue after disabling bracketed paste.

@takluyver
Copy link
Owner

My /etc/profile.d/vte.sh contains a check that it's running under VTE, which skips the VTE integration if not:

 # Not running under vte?
[ "${VTE_VERSION:-0}" -ge 3405 ] || return 0

Does yours have this? I guess it might be inheriting VTE_VERSION if you've started Jupyter from a VTE based terminal (gnome-terminal or similar). So maybe bash_kernel should just look for this and unset it, so bash doesn't think it's running in VTE.

@gsauthof
Copy link

gsauthof commented Jul 6, 2022

Yes, my /etc/profile.d/vte.sh also has that line.
And I'm also starting Jupyter from a terminal (that runs zsh - which probably doesn't make a difference).
But it isn't VTE based.
It's kitty.

@kdm9
Copy link
Collaborator

kdm9 commented Aug 24, 2022

I've recently taken on co-maintaining bash_kernel, and I'm currently closing all old/stale issues.

I'm closing this issue as it should have been solved in version 0.8 with PR #120. Please reopen if you need further help.

@kdm9 kdm9 closed this as completed Aug 24, 2022
@moneroexamples
Copy link
Author

@kdm9 Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants