os-patches icon indicating copy to clipboard operation
os-patches copied to clipboard

Provide a patch for "Process exited with errors" notification

Open ryonakano opened this issue 2 years ago • 2 comments
trafficstars

What Happened?

Looking at the code it looks like Terminal sends an error notification when the executed command failed:

https://github.com/elementary/terminal/blob/d76a388fc3327007724414efe4418bb829c42bdf/src/Application.vala#L161-L164

However, I've never seen this and instead I always see the successful notification even if the executed command failed.

Steps to Reproduce

  1. Open Terminal
  2. Run the following command: sleep 3; false
  3. Make the Terminal background so that it sends notification after executing the command
  4. See the successful notification is shown
  5. Go back to Terminal and run echo $?
  6. See 1 (which commonly means error) is shown

Expected Behavior

Error notification should be shown instead of the successful notification if the executed command returned non-0 value.

OS Version

7.x (Horus)

Software Version

Latest release (I have run all updates)

Log Output

N/A

Hardware Info

  • CPU: AMD Ryzen 5 3400G
  • RAM: 16 GB
  • Graphics: iGPU
  • Storage: 490 GB NVMe SSD

ryonakano avatar Aug 14 '23 07:08 ryonakano

The code that trigger the notfication is this: https://github.com/elementary/terminal/blob/d76a388fc3327007724414efe4418bb829c42bdf/src/Widgets/TerminalWidget.vala#L71-L77

$__bp_last_ret_value was provided by a patch in bash that i believe we don't apply anymore.

Marukesu avatar Aug 14 '23 16:08 Marukesu

Thank you for your information. So, we need to set up the bash-jammy branch with that patch (and Launchpad too if needed) to fix this issue.

@tintou Would you take a look at this because you often work on os-patches repository?

ryonakano avatar Aug 16 '23 02:08 ryonakano

Just waiting to see if it builds okay: https://code.launchpad.net/~elementary-os/+recipe/bash-noble

danirabbit avatar May 30 '24 18:05 danirabbit

Patch built and issue confirmed fix! https://code.launchpad.net/~elementary-os/+archive/ubuntu/os-patches/+packages?field.name_filter=bash&field.status_filter=published&field.series_filter=

danirabbit avatar Jul 29 '24 20:07 danirabbit