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

[9fans] Acme-sac integration with Windows NT

189 views
Skip to first unread message

Aram Hăvărneanu

unread,
May 18, 2010, 4:28:53 PM5/18/10
to
Hello,

I've been a long time vi(m) user. I use it everywhere, UNIX or
Windows. I explored other alternatives and I am very happy with acme.
Acme is great.

(Unfortunately), I have to use Windows. I write Windows drivers. I use
acme-sac and runs great on Windows. However, acme is more then an
editor. You can also use it as a terminal for typing commands in it.
Writing Windows drivers is very CLI centric, so I'd like to use acme
as an integrated environment where I can type Windows commands in it
instead of having a lot of Windows command prompts opened.

Is this possible? Can acme be used as a front-end to cmd.exe?

Thanks!

--
Aram Hăvărneanu

Ethan Grammatikidis

unread,
May 18, 2010, 4:44:41 PM5/18/10
to

Acme's `win' accepts a command to execute. I imagine you could enter
`win cmd.exe', 2-drag to select it, and if cmd.exe behaves itself
you'd have an acme window with cmd.exe in it.

>
> Thanks!
>
> --
> Aram Hăvărneanu
>

--
Simplicity does not precede complexity, but follows it. -- Alan Perlis


Aram Hăvărneanu

unread,
May 18, 2010, 5:44:58 PM5/18/10
to
On Tue, May 18, 2010 at 11:42 PM, Ethan Grammatikidis
<eek...@fastmail.fm> wrote:
>
> if cmd.exe behaves itself you'd have an
> acme window with cmd.exe in it.
>

I think it does not behave itself. I think Windows consoles don't work
like UNIX /dev/pty*, but like /dev/vcs*. It seems like windows console
programs work with screen buffers, something like using curses. That's
why there are Windows API functions for changing colour and moving
cursor position in the console window's screen. Piping cmd.exe to some
other process doesn't seem to be enough.

--
Aram Hăvărneanu

Steve Simon

unread,
May 18, 2010, 7:16:20 PM5/18/10
to
> It seems like windows console
> programs work with screen buffers, something like using curses.

This is the case for a few windows commands but many, even the majority don't
use windows console functions, they just read from stdin and writ to stdout
so you can run then via a pipe.

I do this all the time as I have a Plna9 desktop but have a cpu(1) like command
dos(1) which opens a session to a windows box for command line access; I write
embedded code which is crosscompiled using gcc on windows.

I wil describe this more if you like and you can have the code but I'am
on holiday for a week.

-Steve

Arvindh Rajesh Tamilmani

unread,
May 19, 2010, 2:40:33 AM5/19/10
to
acme-sac on windows is my development environment too.

b2 on 'win os cmd' gives a cmd.exe window. i prefer sh(1),
so i use just 'win' and access the windows files from /n/C.
i have shell functions defined in $home/lib/functions to
invoke specific windows commands.

for example:

fn ant {
{os -T ant.bat $* | dcr} $* |[2] dcr >[1=2]
}

and the following rule in $home/lib/plumbing to enable b3 on
windows file names output by ant.

# Microsoft Windows file names, possibly tagged by line number, go to acme
kind is text
data matches '(^[a-zA-Z]):([.a-zA-Z0-9_/\-\\]+[a-zA-Z0-9_/\-\\])(:(((#?[0-9]+)|(/[A-Za-z0-9_\^]+/?)|[.$])([,;+\-]((#?[0-9]+)|(/[A-Za-z0-9_\^]+/?)|[.$]))*))?'
plumb alwaysstart acme
plumb start /dis/sh.dis -c 'plumb -d edit -a action showfile -a addr
$4 /n/^`{echo $1 | tr A-Z a-z}^`{echo $2 | tr ''\\ '' /␣}'

arvindh

Aram Hăvărneanu

unread,
May 19, 2010, 5:27:20 PM5/19/10
to
On Wed, May 19, 2010 at 9:36 AM, Arvindh Rajesh Tamilmani
<arvi...@gmail.com> wrote:
> acme-sac on windows is my development environment too.
>
> b2 on 'win os cmd' gives a cmd.exe window.  i prefer sh(1),
> so i use just 'win' and access the windows files from /n/C.
> i have shell functions defined in $home/lib/functions to
> invoke specific windows commands.
>

I very much prefer a Plan9/UNIX environment myself. I have to use
Windows build tools and static verifier tools, but I think I'll follow
your advice and create some wrappers for them for the most common use
cases. Opening an additional command prompt occasionally is not a
problem, having everything integrated 95% of the time would be great.

--
Aram Hăvărneanu

6o20...@sneakemail.com

unread,
May 19, 2010, 11:44:10 PM5/19/10
to
How do you folks using acme-sac on Windows deal with the line-ending
issue? I've been using P9P acme on linux (at work) since Russ announced
it, but I consider the line-ending issue a show-stopper on Windows.

While the cr displayed at the end of every line is annoying, I could
probably learn to live with it. When I start editing, though, I doubt I
have enough discipline to remember add the cr, and if I don't remember I
would end up with files with mixed line-endings. Some windows tools
aren't happy if the files don't use windows line endings.

Peter Canning

Arvindh Rajesh Tamilmani

unread,
May 20, 2010, 1:52:18 AM5/20/10
to
> How do you folks using acme-sac on Windows deal with the line-ending
> issue?

pipefs(4) can be used to filter windows directory trees:
http://groups.google.com/group/acme-sac/msg/973e8c67b33a7976

and also to filter /chan/snarf (in $home/lib/profile):
http://groups.google.com/group/acme-sac/msg/cf5b3107e0d00d49

os commands can be filtered through dcr:
http://code.google.com/p/acme-sac/source/browse/man/1/dcr
for an example, see the ant wrapper i posted in this thread.

/n/sources/rsc/contrib/scripts:
http://groups.google.com/group/acme-sac/msg/15378eee84e15052

arvindh

yy

unread,
May 20, 2010, 4:43:22 AM5/20/10
to
If you are using cygwin, you can use sh from acme-sac:

win os C:\cygwin\bin\run.exe -p /bin sh -i

or if you do not need access to the rest of the cygwin commands:

win os C:\cygwin\bin\sh -i

--
- yiyus || JGL . 4l77.com

Arvindh Rajesh Tamilmani

unread,
May 21, 2010, 6:45:55 AM5/21/10
to
> If you are using cygwin, you can use sh from acme-sac:

it is possible to b3 on a relative file name in a
cygwin window and get it opened in acme-sac.
you'll need the label patch to win[1], bin/awd and
bin/label from plan9port and a cd wrapper as
described in the example section of label(1)[2].
also, the default cygdrive path prefix should be
changed from /cygdrive to /n.

many little conventions like this could be found
in the archives and web ([3] comes to mind), which
make working with acme a delight :-)

arvindh

[1] http://code.google.com/p/acme-sac/source/detail?r=640287ed62
[2] http://swtch.com/plan9port/man/man1/label.html
[3] http://www.cse.yorku.ca/~oz/wily/idioms.html

Robert Raschke

unread,
May 24, 2010, 5:15:51 AM5/24/10
to

When I start editing some random file in acme-sac, I do (pretend it's a proper c/r character below)

Edit ,x//d

and if I need them back in for Windows purposes, I do

Edit ,x/\n/i//

Sometimes I forget. But it's never really been an issue. I do not know of any Windows tool that requires c/r these days. And most people, when opening in Notepad just go Ach! and open in Wordpad instead.

Robby


hiro

unread,
May 24, 2010, 2:13:11 PM5/24/10
to
Wordpad on windows 7 sucks :D
0 new messages