# Stabilizing zsh shell

First you will need to spawn a TTY shell. This can be either done with the scripts command or using the python command.

## Using the scripts command:

```bash
script -qfc /bin/bash /dev/null
```

## Using Python:

```bash
python -c 'import pty; pty.spawn("/bin/bash")'
```

## Using Python 3:

```bash
python3 -c 'import pty; pty.spawn("/bin/bash")'
```

After spawning a TTY shell, you can stabilize the shell to enable tab auto-complete and no accidental CRTL+c that will terminate your shell.

Firstly, background your shell with the following keyboard command:

```bash
ctrl + z
```

Then paste into your terminal the following (This will also foreground your shell again):

```bash
stty -a | head -n1 | cut -d ';' -f 2-3 | cut -b2- | sed 's/; /\n/'
stty raw -echo; fg
stty rows ROWS cols COLS
```

And finally paste in the following command in your terminal:

```bash
export TERM=xterm-256color
exec /bin/bash
reset
```
