0

I'm using Kubuntu 14.04. When I exiting terminal emulator (konsole or yakuake) by doing something like kill -9 $$ it doesn't close, and saying:

Warning: Program '/bin/bash' crashed.

How could I disable this behavior and force terminal emulator to silently close when shell is killed?

In the same system, when prompting kill -9 $$ in xterm, it exits without any crash reported.

I don't remember exactly, in which Linux distributions I saw such "silent" behavior from-the-box, but there are some.

Update: the reason to do so is to exit terminal emulator without saving history to .bash_history.

AntonioK
  • 1,193

1 Answers1

8

Please consider editing /etc/profile. At the bottom add:

unset HISTFILE && exit

for your current session. If wanting all history gone, try:

rm -f $HISTFILE && unset HISTFILE && exit

Killing an app is not the most graceful approach. See Quit Bash Shell Without Saving Bash History (5 Methods). Avoid #2, as this is what you are trying now.

eyoung100
  • 6,252
  • 23
  • 53
  • Thank you, that's solving my issue. So I could now make an alias for bash, something like alias french_exit='unset HISTFILE && exit' – AntonioK Sep 26 '15 at 08:44