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

__bp_preexec_invoke_exec "$_" printed when running multiple commads #1895

Open
clupasq opened this issue Jun 14, 2021 · 5 comments
Open

__bp_preexec_invoke_exec "$_" printed when running multiple commads #1895

clupasq opened this issue Jun 14, 2021 · 5 comments

Comments

@clupasq
Copy link
Contributor

clupasq commented Jun 14, 2021

Ctrl + X, Ctrl + E allows opening the current bash command in the default editor.
I sometimes to this to enter multiple commands (separated by newline).
After saving and exiting the editor, the commands are run as expected.

For the examples below I'll consider the following commands:

echo 1
echo 2
echo 3

Expected Behavior

What is expected is that only the commands and their results are being printed to the console.
Here's an example of such an interaction without bash-it:

$> echo # <== at this point I fired up the editor to type in the aforementioned command(s).
echo 1
1
echo 2
2
echo 3
3

Current Behavior

Here's what's being printed when using bash-it:

❯ echo # <== using the editor to type in the commands again
echo 1
__bp_preexec_invoke_exec "$_"
1
echo 2
__bp_preexec_invoke_exec "$_"
2
echo 3
__bp_preexec_invoke_exec "$_"
3

Possible Solution

At this moment I have not looked into a solution.
If other people have this issue and want it solved, I'll look into it.

Context

This is not an important bug, it's more like a nitpick.

Steps to Reproduce

  1. Press Ctrl + X, Ctrl + E on the command line
  2. Use the editor to enter more than one command (newline separated)
  3. Save && exit
  4. Inspect the output. You're likely to see the expected output, plus some __bp_preexec_invoke_exec "$_" lines between each command and its output.

Your Environment

  • Bash-it version used: dev (git SHA: 2444a57 on 2021-06-10T16:04:56+03:00)

  • List of enabled plugins, themes and aliases (use bash-it show (plugins/themes/aliases)): no plugins, no aliases, powerline-multiline theme (also tested with themes bobby & nwinkler and got the same result)

  • bash-it doctor output:

  • Bash version: 5.0.3(1)-release

  • Operating System and version: Debian 10 (buster)

Your Bash Config File

  # Will provide more details if relevant. Basiclaly it's a standard bash-it config, with:
export BASH_IT_THEME='powerline-multiline'
export BASH_IT_COMMAND_DURATION=true
@NoahGorny
Copy link
Member

Hi @clupasq, sorry for the late response.
What terminal do you use that allows you to edit the current command-line?
I want to try and reproduce it myself

@cornfeedhobo
Copy link
Member

cornfeedhobo commented Jul 5, 2021

@clupasq Thanks for the report! This is an advanced usage of bash and an interesting bug you've found! I think you will need to follow this up with an issue to the rcaloras/bash-preexec library. We are embedding it into this project.

@clupasq
Copy link
Contributor Author

clupasq commented Jul 6, 2021

@NoahGorny I'm using mainly KDE's Konsole, but could also reproduce it in the Gnome terminal.

@clupasq
Copy link
Contributor Author

clupasq commented Jul 6, 2021

@cornfeedhobo Thanks, I'll post an issue there. 👍

EDIT: I posted an issue to bash-preexec: rcaloras/bash-preexec#116

@cornfeedhobo
Copy link
Member

@clupasq awesome! Thanks for following up. I'll definitely keep an eye on this. This is a really interesting corner case you've stumbled on.

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

3 participants