You are not logged in.
Pages: 1
I use xterm on a regular basis and bash is my preferred shell, but I enjoy using Acme from Plan9. In cases when I am using Acme, I prefer rc over bash and would like that to be the default for 9term. How can I do this?
The problem comes down to: "How can make my shell dependent on which terminal I am using?"
I have tried several things, but none have worked yet. Any suggestions?
D.
Last edited by dglmoore (2011-01-11 04:24:42)
Offline
How do you start your terminals? 'xterm -e bash' takes care of the first case and a similar command will launch rc in 9term, I suppose.
Offline
Well, bash is my default shell so issuing 'xterm' gives me bash. I would prefer 9term to default to rc so that issuing '9term' or 'win' (in Acme) would start 9term with rc as the shell.
Within .bashrc if I
export SHELL="/opt/plan9/bin/rc"
it starts every terminal with rc. I also tried
case "$TERM" in
9term) export SHELL="/opt/plan9/bin/rc";;
*) export SHELL="/bin/bash";;
esac
But bash starts in every terminal, although
echo $SHELL
in 9term returns rc.
Offline
Maybe $TERM is not 9term.
Can't you alias 9term to something like 'xterm -e bash' but for 9term & rc?
I don't know a thing about Acme so I don't know how to solve the 'win' part.
Offline
Yes, $TERM is 9term. Setting up an alias would work, but I have other settings that are dependent on the terminal. It would be nice if I could set the shell as well as those other settings in the same place. At the moment, all of those other settings work perfectly, and I suppose SHELL does too. I mean, it is setting that environment variable, 9term just isn't using it to determine which shell to use?
Regarding Acme, if I get 9term to start with rc, the win command will start rc.
Offline
But bash starts in every terminal, although
echo $SHELL
in 9term returns rc.
Even if you run 'xterm -e rc'? It should start rc.
Maybe try
export SHELL="/opt/plan9/bin/rc" && 9term
Offline
That works; it opens 9term with rc as the shell. However, that is no better than '9term rc'.
I need '9term' to start 9term with rc running and 'xterm' to start xterm with bash.
Last edited by dglmoore (2011-01-11 14:03:34)
Offline
I need '9term' to start 9term with rc running and 'xterm' to start xterm with bash.
So exporting shells + specifying which shell to use is not enough?
Offline
Would you want to type
export SHELL="/opt/plan9/bin/win" && 9term
every time you opened 9term?
I will always want 9term to use rc so typing
9term rc
to run 9term is not the best.
I need a way, preferably not using aliases, to specify from a .profile, .bash_profile, .bashrc, etc to use rc in 9term and bash in any other terminal.
It seems like this should be much more simple than it is.
Offline
XTERM_SHELL
is set to the pathname of the program which is invoked. Usually that is a shell program, e.g., /bin/sh.
Since it is not necessarily a shell program however, it is distinct from "SHELL".
Maybe you need to dig into the manuals?
I have
yeahconsole*term: urxvt
in my .Xdefaults - maybe 9term has a similar option.
Offline
From the 9term man page:
9term runs the given command in the window, or $SHELL if no command is given.
The 'given command' it is referring to is a command line option.
By that, it should be running rc, but it isn't.
Offline
But you said 'export SHELL="/opt/plan9/bin/rc" && 9term' works. If you don't like aliases, maybe bind it to a keyboard shortcut.
case "$TERM" in
9term) export SHELL="/opt/plan9/bin/rc";;
*) export SHELL="/bin/bash";;
esac
doesn't work - I think the new term inherits the $SHELL from the one it was called.
Offline
karol has already given the answer. Figure out how you're calling 9term and change it. e.g., if launching from xmonad, change your xmonad.hs.
and no, changing SHELL when bash has already launched will not magically cause bash to switch to another shell. (see man bash for what SHELL is set to)
(and if it interests anyone, there does exist a form of 9term which reads Xdefaults)
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
changing SHELL when bash has already launched will not magically cause bash to switch to another shell.
I understand that. However, if I put the following in my .bashrc (note that my default shell is bash):
export SHELL="/opt/plan9/bin/rc"
then every terminal will open running rc. So, at some point this export command is being read and tells the terminals to run rc. Of course, this is at some point being read by bash because it the .bashrc file.
Can't you alias 9term to something like 'xterm -e bash' but for 9term & rc?
I can't use an alias because I am not actually calling the command from a bash shell, I am running them from within acme. Hence a bash alias is useless.
If you don't like aliases, maybe bind it to a keyboard shortcut.
Again, because I am running a command from within acme, keyboard shortcuts are a no go.
It seems like a simple problem, but nothing I tried is a viable solution.
Offline
Again, 'export SHELL="/opt/plan9/bin/rc" && 9term' works. You first set the $SHELL variable to whatever you want and only then you start the terminal you choose. In 'case "$TERM" in' you first start a terminal, read its $TERM and set the $SHELL. If you run 9term now (i.e. open another terminal from the newly opened one), everything will be as you want it.
What exactly is acme calling - the binary? Can't you configure it so that it executes a macro instead (I'm just guessing here)?
Also, 9term that reads Xdefaults sounds promising.
Offline
fsckd wrote:changing SHELL when bash has already launched will not magically cause bash to switch to another shell.
I understand that. However, if I put the following in my .bashrc (note that my default shell is bash):
export SHELL="/opt/plan9/bin/rc"
then every terminal will open running rc. So, at some point this export command is being read and tells the terminals to run rc. Of course, this is at some point being read by bash because it the .bashrc file.
Yes since the terminals are called from an environment set up by bash (or derived therefrom). I was reacting to the strange case "$TERM" in structure from earlier in this thread.
I assume you're using plan9port. The only thing I can suggest is modifying /opt/plan9/bin/9 to set a new SHELL. That should affect both 9term and win in acme.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Pages: 1