Groups | Search | Server Info | Login | Register
Groups > comp.os.os2.programmer.misc > #1713
| Newsgroups | comp.os.os2.programmer.misc |
|---|---|
| Date | 2023-07-15 15:34 -0700 |
| References | <a29691a7-9701-4935-a5b2-986c5f5c2bddn@googlegroups.com> <Aj3sM.255151$edN3.186930@fx14.iad> <83234834-db2d-42ac-8bc6-0fcf631f53b9n@googlegroups.com> |
| Message-ID | <7ee4e13c-63ae-4c02-a17d-b183c5045e92n@googlegroups.com> (permalink) |
| Subject | Re: win32 via odin |
| From | xhajt03 <xhajt03@gmail.com> |
On Saturday, July 15, 2023 at 7:02:14 UTC+2, Paul Edwards wrote:
.
.
> > > However, programs of mine that use ANSI escape codes
> > > do not work properly - the ESC appears to be ignored/
> > > swallowed.
>
> > Not sure about that one, perhaps someone else has some insight.
> I have confirmed that when I build my own OS/2 native
> executables, the escape sequences take effect.
I believe that Win32 console applications executed via Odin are actually run in a PM window rather than a real OS/2 console window and ANSI codes are probably not interpreted there.
> So if I go the route of writing a public domain, somewhat
> minimal, win32 environment for OS/2, I know that the
> escapes will get through.
>
> However, I still have a problem with keyboard input. I
> need to get ANSI escapes - or at least - something -
> when I press the different cursor keys. Otherwise my
> version of microemacs 3.6 (also public domain - that
> older version) won't work.
>
> So I wrote a test program, and if I build it as a win32
> executable (using pdpclib) and run it under "pec", all
> the cursor keys generate a x'e0'.
>
> If I instead build an OS/2 native executable (also with
> pdpclib), I don't get any input at all.
>
> The "keys off" command doesn't change either of
> the above.
>
> PDPCLIB is using this code:
>
> C:\devel\pdos\pdpclib>git diff stdio.c
> diff --git a/pdpclib/stdio.c b/pdpclib/stdio.c
> index 685e3e4c..f6b837e6 100644
> --- a/pdpclib/stdio.c
> +++ b/pdpclib/stdio.c
> @@ -1921,6 +1921,7 @@ static void iread(FILE *stream, void *ptr, size_t toread, size_t *actualRead)
>
>
> #ifdef __OS2__
> +printf("about to do dosread of %d\n", (int)stream->hfile);
> rc = DosRead(stream->hfile, ptr, toread, &tempRead);
> if (rc != 0)
> {
>
> C:\devel\pdos\pdpclib>
>
>
> ie doing a DosRead from handle 0.
>
> I thought there might be a DosDevIOCtl that governs this
> behavior, so I went looking for the documentation.
>
> I was surprised that this was all I could find online:
>
> http://www.edm2.com/index.php/DosDevIOCtl
>
> which is insufficient. I actually need three things for
> a fullscreen editor like microemacs:
>
> 1. Cursor keys to come through with unique codes.
> 2. Echo switched off.
> 3. Line buffering switched off.
>
> On MSDOS I can use INT 21H AH=44H to change those
> last two things. But without documentation I don't know
> if the equivalent exists in OS/2. I know what is required
> in Windows too.
> > > In addition, the doco says that the driver is no longer
> > > working, so I need to run everything via pec. Which
> > > probably means I need to provide my own shell.
> > > Which I can probably do, as I have 3 flavors of my
> > > shell already (for 3 different flavors of PDOS).
>
> > Wonder if it is possible to run PDOS in a DOS session?
> PDOS/86 is an 8086 OS, so it would be a replacement
> for OS/2's DOS, and not be useful regardless.
>
> But PDOS/386 has the infrastructure to do 32-bit for
> Windows, so as above - I can potentially do what I want
> in an OS/2 window.
>
> Although - I just realized while typing this that I could
> possibly install HX into a DOS window to run everything.
>
> I come close to being able to do that in Freedos+HX
> already.
> > > But that won't really work without ANSI escapes. ;-----;;;;;;;
> I think the VIO thing is what is swallowing the ESC character.
> And what I need to do is switch to standard streams.
I don't think that you can ever get cursor keys from stdin under OS/2 - only regular characters are delivered that way. You'd need to use the (16-bit) kbdcalls with thunking, or some wrapper around it (EMXWRAP.DLL from EMX runtime, or something else).
Tomas
Back to comp.os.os2.programmer.misc | Previous | Next — Previous in thread | Next in thread | Find similar
win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-13 13:46 -0700
Re: win32 via odin Dave Yeo <dave.r.yeo@gmail.com> - 2023-07-13 20:30 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-14 22:02 -0700
Re: win32 via odin xhajt03 <xhajt03@gmail.com> - 2023-07-15 15:34 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-15 16:05 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-15 17:56 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-15 18:29 -0700
Re: win32 via odin xhajt03 <xhajt03@gmail.com> - 2023-07-15 20:43 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-15 23:17 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-15 23:47 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-16 02:20 -0700
Re: win32 via odin xhajt03 <xhajt03@gmail.com> - 2023-07-16 03:58 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-16 09:03 -0700
Re: win32 via odin xhajt03 <xhajt03@gmail.com> - 2023-07-16 14:51 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-12-20 10:35 +0800
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-12-20 14:16 +0800
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-12-20 16:24 +0800
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-12-20 20:10 +0800
Re: win32 via odin Dave Yeo <dave.r.yeo@gmail.com> - 2023-07-16 20:30 -0700
Re: win32 via odin Dave Yeo <dave.r.yeo@gmail.com> - 2023-07-16 20:44 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-16 21:11 -0700
Re: win32 via odin Dave Yeo <dave.r.yeo@gmail.com> - 2023-07-16 23:04 -0700
Re: win32 via odin Dave Yeo <dave.r.yeo@gmail.com> - 2023-07-16 23:11 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-17 07:07 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-17 07:13 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-17 07:48 -0700
Re: win32 via odin Paul Edwards <mutazilah@gmail.com> - 2023-07-17 16:50 -0700
csiph-web