Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Running tclsh from MinGW's shell

259 views
Skip to first unread message

Will Duquette

unread,
Oct 4, 2011, 6:08:11 PM10/4/11
to
Does anyone have any experience running tclsh from MinGW's MSYS
shell? I've got a TCLLIBPATH with two directories in it, and no
matter what I do at least one of them gets translated badly by MSYS as
it's being passed to tclsh. I figure there must be some way to deal
with this....

Kevin Walzer

unread,
Oct 4, 2011, 8:37:13 PM10/4/11
to
I have found msys and mingw to be *very* flakey, for whatever reason,
and have removed them from my Windows system. I know this doesn't help,
but I'm more productive running in the Wish console or in cmd.exe.

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com

arjenmarkus

unread,
Oct 5, 2011, 3:07:06 AM10/5/11
to
What version of MSYS are you using? There has been a significant
improvement not too long ago, though I admit I am not an expert
vis-a-vis MSYS.

Regards,

Arjen

Emmanuel Frecon

unread,
Oct 5, 2011, 6:11:12 AM10/5/11
to
Have you tried mobaXterm, it is a cygwin distribution packaged into a single executable which I have been starting to use lately with proper success. Don't know if it will help in your case though.

Will Duquette

unread,
Oct 5, 2011, 11:25:38 AM10/5/11
to
I've got a Tcl app running on Linux with some locally-written C
extensions. Now I need to port the app to Windows; but much of the
code will still continue to be used on Linux. I want the Makefiles,
etc., to work the same on Windows as they do on Linux. Hence, MinGW/
MSYS. It's all about building the code.

The problem with TCLLIBPATH appears to be that it's white-space
delimited; MSYS's path translator expects paths to be either ":" or
";" delimited, and so treats the TCLLIBPATH as one long directory
name.

Sigh.

My solution so far has been to unset TCLLIBPATH, and instead define a
Tkcon config file that adds the relevant lib directories to
auto_path. Then I can use Tkcon to run casual scripts that use my
development libraries.

Will Duquette

unread,
Oct 5, 2011, 11:26:12 AM10/5/11
to
On Oct 5, 3:11 am, Emmanuel Frecon <efre...@gmail.com> wrote:
> Have you tried mobaXterm, it is a cygwin distribution packaged into a single executable which I have been starting to use lately with proper success. Don't know if it will help in your case though.

I may take a look at it; however, as I said in a previous reply, I
need to be able to use MSYS as well.

tomk

unread,
Oct 5, 2011, 11:44:39 AM10/5/11
to
Hi Will,
I have after I retired a few years back I was forced to move from unix
to windows so I started using MSYS/MinGW. I took me a while to get my
windows box configured so it works more or less like a unix system.
The predefined environment variables never worked for me at work
because the networking and installation was out of my control. As a
result I never depended on them and thought they were a bad idea. I
build my PATH variable in my .bashrc file and haven't had any problem
with MSYS/MinGW. I can send you more details if you are interested.
Tom K.

tomk

unread,
Oct 5, 2011, 11:56:27 AM10/5/11
to
On Oct 4, 3:08 pm, Will Duquette <w...@wjduquette.com> wrote:
Hi Will,
I use MSYS/MinGW however I don't depend on TCLLIBPATH so don't have
the problem you are experiencing. I used to work on unix in an office
that had 1000's of computers that were networked and administer by
other people that couldn't maintain a stable environment. As a result
I depended on almost no predefined environment variables. I build my
PATH variable in my .bashrc file and extend my tcl auto_path based on
the needs of the application. I can send you more details if you are
interested.
Tom K.

Pat Thoyts

unread,
Oct 6, 2011, 10:38:08 AM10/6/11
to
Actually TCLLIBPATH is only meaningful to Tcl (it is read in init.tcl)
and it is used as a tcl list. Msys shouldn't be touching it at all.

The main issue I've seen using msys with tclsh is that stdout gets
connected to a pipe in the rxvt shell they use and tclsh decides it is
not interactive and doesn't show a prompt. 'set tcl_interactive 1' fixed
that.

--
Pat Thoyts http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD

Will Duquette

unread,
Oct 6, 2011, 3:40:47 PM10/6/11
to
On Oct 6, 7:38 am, Pat Thoyts <pattho...@users.sourceforge.net> wrote:
MSYS attempts to be helpful with directory names. $HOME, for example,
is set to be C:\Users\will, but it appears in MSYS as /c/Users/will.
And then, when it is passed along to a process called from MSYS it
gets translated back to C:/Users/will. I imagine MSYS does this with
all of the environment variables: it wants to make them useful within
MSYS, but then needs to make them useful to non-MSYS apps. I'll note
that TCLLIBPATH works great when it's just one directory, but because
it's whitespace delimited, MSYS doesn't realize that there are
multiple directories and only translates the first one. Sigh.

tomk

unread,
Oct 9, 2011, 2:12:05 PM10/9/11
to
On Oct 6, 7:38 am, Pat Thoyts <pattho...@users.sourceforge.net> wrote:

I tried 'set tcl_interactive 1' and it only works with tclsh. It
doesn't cause a prompt when you run wish.
tomk

Christian Gollwitzer

unread,
Oct 9, 2011, 2:30:31 PM10/9/11
to
Am 09.10.11 20:12, schrieb tomk:

> I tried 'set tcl_interactive 1' and it only works with tclsh. It
> doesn't cause a prompt when you run wish.

The native windows wish is compiled as a windowing program. That means,
it doesn't have stdin/stdout set up (to avoid popping up a console
window). As an alternative, you can use "console show" or tkcon.

Christian

björn lundin

unread,
Oct 10, 2011, 5:52:05 PM10/10/11
to

>
> I've got a Tcl app running on Linux with some locally-written C
> extensions.  Now I need to port the app to Windows; but much of the
> code will still continue to be used on Linux.  I want the Makefiles,
> etc., to work the same on Windows as they do on Linux.  Hence, MinGW/
> MSYS.  It's all about building the code.
>
I work on a system running on xp/w2k3/w2k8, aix and linux
We use makefiles, and from them we call tcl scripts, which does
various thing, like autogenerating code. We use the same makefiles
everywhere.
Mingw on all windowses. Works really well. I did try on freebsd, and
it built there too.
It is a powerful combo, tcl and make

I think i set libpath in the scripts realative to the script, so i did
Not encounter trouble there

/björn

0 new messages