accessing the CLI in a prog - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: accessing the CLI in a prog (/showthread.php?tid=2416) Pages:
1
2
|
RE: accessing the CLI in a prog - PhilOfPerth - 01-31-2024 (01-31-2024, 11:48 AM)SMcNeill Wrote: Ah, purrfic! Great work... short and sweet. Thanks again to all. RE: accessing the CLI in a prog - GareBear - 02-01-2024 SMcNeill, Here's what I run QB64PE 3.11.0 IDE with: Kernel - Linux/x86_64 6.6.10-76060610-generic Kernel OS Name - Pop!_OS 22.04 LTS OS Type - 64-bit Windowing System - X11 Desktop Environment - GNOME 42.5 Terminal - gnome-terminal Shell - bash 5.1.16 This OS is light enough to run on a Windows 7 machine along with a 1TB hard drive. The IDE does not lock up my system with this combination of OS and hard drive. I tried to include everything you might need to know. When I ran it with the '$Console:Only'. It just compiled and no display with a OK to show it was finished. When I ran it with '$Console' it displayed the directory contents along with 'text.txt' in the listing and the usual 'Press any key to continue' when finished. I think this is what you wanted to know what I have. If you need to know more let me know. - GareBear RE: accessing the CLI in a prog - SMcNeill - 02-01-2024 I think the problem comes from this: Quote:The IDE doesn't currently launch `$Console` programs in a terminal on Linux, so you just don't see anything unless you're watching the terminal you launched the IDE from. Any chance you just wasn't looking in the right place to see the output? I'm not a Linux user, so I'm hoping that's all the issue is. If not, it'll be up to one of our Linux gurus to help sort out the issue and whatever the problem might be. Steve holds a lot of solutions in his old hat, but even he can't solve 100% of all issues all the time. RE: accessing the CLI in a prog - DSMan195276 - 02-01-2024 (02-01-2024, 01:24 AM)GareBear Wrote: SMcNeill,The issue is that the IDE doesn't spawn a new terminal to run your program in, so the output of the program will just appear in the terminal you started the IDE from (if you didn't start the IDE from a terminal, then the output may not be visible anywhere). I believe we have a bug report on this, the IDE should really find and start a terminal for you (and warn you if it doesn't find one). That said if you open a terminal and run the compiled program that way then you will see the output you're expecting. Also note that `$Console` and `$Console:Only` are very different, practically different commands. In your code `$Console` does nothing - it enables read/write from the console but there is still a graphical window. Additionally the graphical window is still the default destination for `PRINT` and friends so your program never uses console input/output and what you're seeing is just output on the graphical window, the same as all non-`$Console`. When you use `$Console:Only`, the graphical window is disabled completely and your program reads/writes from/to the console by default. The lack of a graphical window is why you don't see anything. RE: accessing the CLI in a prog - GareBear - 02-01-2024 DSMan195276, All I wanted to do is make a linux version of "CLI in a prog". You are right about no console display. It acted like a regular QB execution and no linux termial showed up. I thought the ':Only' in the $Console line was just a optional switch being I got it to "work". Thanks for the help. Hope the bug is solved easily. - GareBear RE: accessing the CLI in a prog - PhilOfPerth - 02-01-2024 Using some of the bits and pieces I've learned from this forum, I built the small prog below. Not earth-shattering, but I'm quite proud of it. It lets me see the contents of any of my drives. Code: (Select All) Screen _NewImage(1200, 820, 32) RE: accessing the CLI in a prog - Steffan-68 - 02-01-2024 (02-01-2024, 06:17 AM)PhilOfPerth Wrote: Using some of the bits and pieces I've learned from this forum, I built the small prog below.And if you change the last line E.g Print "Press a key": Sleep: Cls: Close #1: Kill ".\temp.txt": Run Would you delete the TEMP file at the end . RE: accessing the CLI in a prog - PhilOfPerth - 02-01-2024 (02-01-2024, 04:28 PM)Steffan-68 Wrote:(02-01-2024, 06:17 AM)PhilOfPerth Wrote: Using some of the bits and pieces I've learned from this forum, I built the small prog below.And if you change the last line E.g Yes, thanks Stefan. Two of my many crimes are forgetting to close files, and to remove them. |