You are not logged in.
Pages: 1
Hello. Whenever I accidentally hit Ctrl-z in a Python session in xfce4-terminal,
[victoria@victoria ~]$ python
...
>>> ## accidental Ctrl-z keypress here
[1]+ Stopped python
[victoria@victoria ~]$
... I stop/kill the process.
How can I disable the Ctrl-z kepyress in xfce4-terminal?
Offline
Solution! Call this bash script via a ~/.bashrc alias:
# bash script (python-ctrl-z-disabled.sh):
#!/bin/bash
# /mnt/Vancouver/Programming/scripts/python-ctrl-z-disabled.sh
# Issue: Ctrl-Z keypress in xfce4-terminal was killing running Python instance.
# Solution: disable Ctrl+z by launching Python via this script:
trap '' INT TSTP
python
~/.bashrc alias:
alias P="/mnt/Vancouver/Programming/scripts/python-ctrl-z-disabled.sh"
Now, launching Python (P) in my terminal in host environment or my Python 2.7
and Python 3.6 virtual environments (venv) allow that Python instance to run
with Ctrl-z disabled, in that python session.
For normal usage, just launch Python in the normal way (python).
Last edited by vstuart (2018-03-03 18:39:20)
Offline
It's not an Xfce or xfce4-terminal issue, but see if this helps:
stty susp undef
will disable the keyboard-initiated suspend signal for most programs, however commands like vim and emacs that have specific bindings for Ctrl-Z will have to be reconfigured individually.
You can add that stty command to your ~/.bash_profile or ~/.profile, logout, login again.
(from Disabling job control in bash (CTRL-Z))
Bonus: What's different between Ctrl+Z and Ctrl+C in Unix command line
Offline
Jinx!
Offline
@alcornoqui: lol, that's also great - thanks!
Offline
Pages: 1
[ Generated in 0.008 seconds, 7 queries executed - Memory usage: 532.98 KiB (Peak: 533.82 KiB) ]