# Terminal crashes on error/autocomplete

**URL:** <https://forum.endeavouros.com/t/terminal-crashes-on-error-autocomplete/48775>\
**Category:** Forum\
**Created:** [December 9, 2023, 5:55pm UTC](https://forum.endeavouros.com/t/terminal-crashes-on-error-autocomplete/48775 "2023-12-09T17:55:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![haligh](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/h/ecb155/32.png) [@haligh](https://forum.endeavouros.com/u/haligh)\
**Post date:** [December 9, 2023, 5:55pm UTC](https://forum.endeavouros.com/t/terminal-crashes-on-error-autocomplete/48775/1 "2023-12-09T17:55:10Z")

</div>

My terminal (any kind, my default is konsole but same behaviour on any other term or on tty even) crashes on any error. Same behaviour when i try to autocomplete i.e. cd Doc followed by a TAB (using bash).  
I did find out that 1) as superuser this is not happening. after a ‘sudo su’, i can use my terminal normally.  
2) When i add a “set +e” at the end of my .bashrc the problem is solved too. The output of “echo $-” is: “ehimBHs” (without the set +e ofc, since that solves the issue).  
From a practical point of view i can use my terminal again, but i want to understand where that exit bash strategy comes from. I most likely did introduce this bug myself, was running some scripts that weren’t meant to run on my machine but on a remote device. Maybe someone out there has ideas where to look for, to avoid further bugs from that odd behaviour.

---

<div class="post-metadata">

**Author:** ![BluishHumility](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/bluishhumility/32/70412_2.png) [@BluishHumility](https://forum.endeavouros.com/u/BluishHumility)\
**Post date:** [December 10, 2023, 3:26am UTC](https://forum.endeavouros.com/t/terminal-crashes-on-error-autocomplete/48775/2 "2023-12-10T03:26:22Z")

</div>

> [@haligh](#):
>
> When i add a “set +e” at the end of my .bashrc the problem is solved too.

It sounds like you may have set the `errexit` option somewhere, which causes the shell to exit immediately if any command it runs exits with a non-zero status. When you set `+e`, it disables this option

Check both your `.bashrc` and `.bash_profile` files for any lines that set or unset the `errexit` option (`set -e` or `set +e`).

---

<div class="post-metadata">

**Author:** ![haligh](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/h/ecb155/32.png) [@haligh](https://forum.endeavouros.com/u/haligh)\
**Post date:** [December 12, 2023, 3:36pm UTC](https://forum.endeavouros.com/t/terminal-crashes-on-error-autocomplete/48775/3 "2023-12-12T15:36:15Z")

</div>

Thanks for your reply. In fact i did look for those things already, but after your comment i had a deeper look and found that i was sourcing other scripts, in which the errexit was set.  
I didn’t know that this sets the strategy globally.  
ISsue solved.

---

<div class="post-metadata">

**Author:** ![system](https://forum.endeavouros.com/uploads/default/original/2X/9/9ea52f9fd5ef8e609e593c362d61a36295f48be8.png) [@system](https://forum.endeavouros.com/u/system)\
**Post date:** [December 14, 2023, 3:36pm UTC](https://forum.endeavouros.com/t/terminal-crashes-on-error-autocomplete/48775/4 "2023-12-14T15:36:32Z")

</div>

Closed on December 14, 2023, 3:36pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
