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
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
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
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
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
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
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
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
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
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