~$ stty start undef
So, is there a way to permanently set "start" as "undef"? Maybe under /etc/? Should I put this command in .bashrc?
You could -- but if you do so, you should definitely surround it with
a check for stdin being a terminal (test -t 0 or equivalent).
Someone might source .bashrc from a binary in order to
access functions that are defined within it.
Greg Wooledge (12024-07-10):
You could -- but if you do so, you should definitely surround it with
a check for stdin being a terminal (test -t 0 or equivalent).
Does bash execute .bashrc when it is not interactive?
Does bash think it is interactive when its input is not a tty?
Hi everybody,
I sometime use "rtorrent" (apt show rtorrent) to download isos and other big files. It happens that when I had to quit rtorrent by press Ctrl-Q I cannot because the key combination Ctrl-Q is trapped by the console due to "stty" default configuration:
David Wright (12024-07-10):
Someone might source .bashrc from a binary in order to
access functions that are defined within it.
That would be shooting oneself in the foot. No need to cater for them.
There are many legitimate or semi-legitimate situations where a .bashrc
file might be read by a shell that's not running inside a terminal.
One of them is if someone chooses to dot in ~/.profile from their
~/.xsession file, or something analogous to it. Or perhaps their
operating system does this automatically in certain kinds of login.
Another might be a scripted ssh session being run from cron, or some
other parent that's not in a terminal. Analogously, the ancient
predecessors of ssh (rsh, rexec) had exactly the same issues.
When adding new commands to your shell dot files, always wrap commands
that assume/require the presence of a terminal in a check for a terminal. You'll save yourself a *lot* of headaches.
Greg Wooledge (12024-07-10):
There are many legitimate or semi-legitimate situations where a .bashrc file might be read by a shell that's not running inside a terminal.
One of them is if someone chooses to dot in ~/.profile from their ~/.xsession file, or something analogous to it. Or perhaps their
operating system does this automatically in certain kinds of login.
Another might be a scripted ssh session being run from cron, or some
other parent that's not in a terminal. Analogously, the ancient predecessors of ssh (rsh, rexec) had exactly the same issues.
What you describe is not legitimate, even semi-, these are hacks by
people who cannot be bothered to organize their configuration properly.
hobbit:~$ echo 'echo I AM BASHRC' >> .bashrc
hobbit:~$ ssh localhost date
greg@localhost's password:
I AM BASHRC
Wed Jul 10 11:01:00 EDT 2024
hobbit:~$
Debian is, by your definition, a hack made by people who cannot be
bothered to organize their configuration properly.
Good to know.
(I won't even bother explaining because you CLEARLY know better than I
do about all topics. Enjoy your day.)
Greg Wooledge (12024-07-10):
(I won't even bother explaining because you CLEARLY know better than I
do about all topics. Enjoy your day.)
The risk of passive-aggressive like that is that you risk to be right.
Hi everybody,
I sometime use "rtorrent" (apt show rtorrent) to download isos and other
big files. It happens that when I had to quit rtorrent by press Ctrl-Q I cannot because the key combination Ctrl-Q is trapped by the console due
to "stty" default configuration:
Franco Martelli wrote:
Hi everybody,
I sometime use "rtorrent" (apt show rtorrent) to download isos and other big files. It happens that when I had to quit rtorrent by press Ctrl-Q I cannot because the key combination Ctrl-Q is trapped by the console due
to "stty" default configuration:
that is a strange choice of termination and i would
actually consider it a bug in rtorrent, ESC or Ctrl-C
should work for that purpose.
Greg Wooledge (12024-07-10):
There are many legitimate or semi-legitimate situations where a .bashrc
file might be read by a shell that's not running inside a terminal.
One of them is if someone chooses to dot in ~/.profile from their
~/.xsession file, or something analogous to it. Or perhaps their
operating system does this automatically in certain kinds of login.
Another might be a scripted ssh session being run from cron, or some
other parent that's not in a terminal. Analogously, the ancient
predecessors of ssh (rsh, rexec) had exactly the same issues.
What you describe is not legitimate, even semi-, these are hacks by
people who cannot be bothered to organize their configuration properly.
On Wed, Jul 10, 2024 at 18:39:38 -0400, songbird wrote:
that is a strange choice of termination and i would
actually consider it a bug in rtorrent, ESC or Ctrl-C
should work for that purpose.
Emacs and bash both use Ctrl-S to do stuff, and in both cases, you need
to reconfigure your (virtual) terminal via stty(1) or equivalent to
disable XOFF/XON flow control before it'll work.
I'm sure these aren't the only three terminal programs that use ^S and/or
^Q as key bindings, under the assumption that you can press those keys without triggering flow control. They're the only ones I'm currently
aware of, but I'd be shocked if there aren't more.
On Wed, Jul 10, 2024 at 21:01:41 -0400, [email protected] wrote:
On 7/10/24 18:57, Greg Wooledge wrote:
On Wed, Jul 10, 2024 at 18:39:38 -0400, songbird wrote:
that is a strange choice of termination and i would
actually consider it a bug in rtorrent, ESC or Ctrl-C
should work for that purpose.
Emacs and bash both use Ctrl-S to do stuff, and in both cases, you need
to reconfigure your (virtual) terminal via stty(1) or equivalent to
disable XOFF/XON flow control before it'll work.
I'm sure these aren't the only three terminal programs that use ^S and/or >>> ^Q as key bindings, under the assumption that you can press those keys
without triggering flow control. They're the only ones I'm currently
aware of, but I'd be shocked if there aren't more.
^Q also quits LibreOffice apps, Thunderbird, Firefox, Pluma, and GIMP.
Those are all X11 clients, though, yes? It's a completely different
story compared to terminal programs.
On 7/10/24 18:57, Greg Wooledge wrote:
On Wed, Jul 10, 2024 at 18:39:38 -0400, songbird wrote:
that is a strange choice of termination and i would
actually consider it a bug in rtorrent, ESC or Ctrl-C
should work for that purpose.
Emacs and bash both use Ctrl-S to do stuff, and in both cases, you need
to reconfigure your (virtual) terminal via stty(1) or equivalent to
disable XOFF/XON flow control before it'll work.
I'm sure these aren't the only three terminal programs that use ^S and/or ^Q as key bindings, under the assumption that you can press those keys without triggering flow control. They're the only ones I'm currently
aware of, but I'd be shocked if there aren't more.
^Q also quits LibreOffice apps, Thunderbird, Firefox, Pluma, and GIMP.
Sadly, the days of designing software to accomodate actual hardware
terminals are quite far behind us.
but for my own purposes i also like to do things for
terminals when they open up (my session manager and the
overall desktop will store multiple desktops and all of
the terminals i have open in each of them when i ask it
to).
then in my .bashrc file i check to see what directory
the terminal opens in and create aliases and other things
for the specific project that i've got in that directory.
it's very nice to have just the aliases and environment
variables and other commands all set up and ready to go.
it's not a hack
On 10/07/2024 20:55, Greg Wooledge wrote:
test -t 0 && stty -ixon
I have a question opposite to the original one. Is it possible to disable xon&xoff for bash prompt, but enable it while foreground commands are running? Sometimes I use [Ctrl+s] to pause verbose output of some tool. On the other hand I do not mind to use forward search in readline history.
Greg Wooledge (12024-07-10):
You could -- but if you do so, you should definitely surround it with
a check for stdin being a terminal (test -t 0 or equivalent).
Does bash execute .bashrc when it is not interactive?
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 00:06:31 |
| Calls: | 12,097 |
| Calls today: | 5 |
| Files: | 15,003 |
| Messages: | 6,517,857 |