Subject: mailing-list for TeXmacs Users
List archive
From : michael graffam <address@hidden>- To: address@hidden
- Subject: GNU bash interface
- Date: Fri, 20 Sep 2002 00:32:12 -0700 (PDT)
While exploring TeXmacs some more and playing with the
mycas example, I noticed that the shell session in
TeXmacs doesn't really facilitate interactive use..
for instance, the current directory reverts to the
TeXmacs cd after each command.
So, I coded a simple TeXmacs interface for bash. The
interface itself is a bash script which uses bash's
eval feature to provide more complete shell access.
This method has limitations too, but it is sufficient
for providing a bit more robust shell.. and it works
right now :)
It might be possible to hook bash directly into
TeXmacs without modification by using a suitable init
script and a special PS1 prompt.
But for now, here is the script:
#!/bin/bash
function nextinput
{
COUNTER=$[$COUNTER+1]
echo -ne "\002"; echo -n "channel:prompt"; echo -ne
"\005"
echo -n "bash($COUNTER)] "
}
echo -ne "\002"; cat << EOF
verbatim:
GNU bash $BASH_VERSION
EOF
nextinput
echo -ne "\005"
while true; do
read buffer
if [ "$buffer" = "exit" ]; then
echo -ne "\005"; exit
fi
echo -ne "\002"; echo -n "verbatim:"
eval $buffer
nextinput
echo -ne "\005"
done
__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
- GNU bash interface, michael graffam, 09/20/2002
- Re: GNU bash interface, Joris van der Hoeven, 09/21/2002
- Re: GNU bash interface, michael graffam, 09/21/2002
- Re: GNU bash interface, Joris van der Hoeven, 09/21/2002
Archive powered by MHonArc 2.6.19.