The aliases that I have defined in .bashrc are not available in the
Mutt shell, after hitting '!'.
On 2017-08-13 11:28, Michael Uplawski wrote:
The aliases that I have defined in .bashrc are not available in the
Mutt shell, after hitting '!'.
Since you mention .bashrc, I assume your /bin/sh is bash (you're not
running debian or ubuntu for example, both of which use dash).
On Mon, 2017-08-14, Ian Zimmerman wrote:[fwiw, I didnt receive the OP, so I don't know if there was additional context] >>> The aliases that I have defined in .bashrc are not available in the
On 2017-08-13 11:28, Michael Uplawski wrote:
Mutt shell, after hitting '!'.
Since you mention .bashrc, I assume your /bin/sh is bash (you're not
running debian or ubuntu for example, both of which use dash).
I use zsh myself on Debian, but I'm pretty sure it's common for users
to have bash as their default shell. dash(1) sounds more like a popular choice for /bin/sh.
As for the OP's problem: ~/.bashrc is run by every /interactive/
shell. Do we know that Mutt's ! command starts an interactive shell?
If it doesn't, it may be hard to find a good place to activate
aliases, You don't want to burden every short-lived shell process in
scripts and pipelines with a lot of startup overhead ... and bash
doesn't even seem to support it.
* Jorgen Grahn, 2017-08-14 09:11 UTC:
On Mon, 2017-08-14, Ian Zimmerman wrote:
Since you mention .bashrc, I assume your /bin/sh is bash (you're not
running debian or ubuntu for example, both of which use dash).
As for the OP's problem: ~/.bashrc is run by every /interactive/
shell. Do we know that Mutt's ! command starts an interactive shell?
Okay, I will choose a few handy commands and handle them explicitly.
Thank you all for the reactions.
On 14 Aug 2017 22:01:21 GMT,
Eike Rathke <erack-nutznetz.n@posteo.de> wrote:
* Jorgen Grahn, 2017-08-14 09:11 UTC:
On Mon, 2017-08-14, Ian Zimmerman wrote:
Since you mention .bashrc, I assume your /bin/sh is bash (you're not
running debian or ubuntu for example, both of which use dash).
I am running Debian but cannot imagine how any Linux-system could
restrict me to use one specific shell. Mine is bash.
As for the OP's problem: ~/.bashrc is run by every /interactive/
shell. Do we know that Mutt's ! command starts an interactive shell?
I understand this remark as a hint. But my research has been aiming at
the use of alias-commands, so far. The exact behavior of the ! command
is much better explained in your following statements, than in the docs,
I guess.
Okay, I will choose a few handy commands and handle them explicitly.
If it doesn't, it may be hard to find a good place to activate
aliases, You don't want to burden every short-lived shell process in
scripts and pipelines with a lot of startup overhead
... and bash doesn't even seem to support it.
I've felt for many years that shell aliases are kind of a trap, for
reasons like this one. They are not always there, and they aren't
inherited. I can imagine one getting used to them though, and I have
no good advice in that scenario.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Good morning, all.
The aliases that I have defined in .bashrc are not available in the Mutt shell, after hitting '!'.
It certainly has to be that way, for a reason and I would not ask, if
it weren't so many on my system:
Is there an alternative to turning each alias into a shell-script or
a macro (or both)?
Add a "shell" config line to your muttrc telling mutt to launch bash
with the -i flag:
From the muttrc manpage:
shell
For some reason your shell, when
launched from mutt, is not recognizing that it is running interactively
and loading the startup file.
Add a "shell" config line to your muttrc telling mutt to launch bash
with the -i flag:
From the muttrc manpage:
shell
Type: path
Default: ""
Command to use when spawning a subshell. By default, the
user's login shell from /etc/passwd is used.
The problem: (which you can only see if you inspect mutt source code, as Jorgen & co. did but I, alas, did not)
/bin/sh -c $shell
if no command was entered, but for a command still /bin/sh -c command
On 2017-08-16 19:08, Eike Rathke wrote:
/bin/sh -c $shell
if no command was entered, but for a command still /bin/sh -c
command
You're right - the configurable shell setting only matters for an
interactive shell.
Why is that even needed today is another question :-) Who here uses
mutt on a real glass tty? In all other situations, you can just
login on a new virtual tty, or start another shell in one.
Ian Zimmerman <itz@primate.usenet-nospam-remove.net> wrote:
On 2017-08-16 19:08, Eike Rathke wrote:
/bin/sh -c $shell
if no command was entered, but for a command still /bin/sh -c
command
You're right - the configurable shell setting only matters for an
interactive shell.
Why is that even needed today is another question :-) Who here uses
mutt on a real glass tty? In all other situations, you can just
login on a new virtual tty, or start another shell in one.
Or, run screen or tmux and just switch to another screen or tmux
'window'.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 60:12:25 |
Calls: | 6,654 |
Calls today: | 6 |
Files: | 12,200 |
Messages: | 5,331,392 |