I want it on windows xD [$15] #40
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I want it in OS X :(
OS X works and a branch has already been created! Check it out https://github.com/Swordifish90/cool-old-term/tree/osx
Nice! How different are the build steps? I guess I'll find out.
edit: I did not find out, I am not good with computer. Can someone help me out by updating the docs, or by holding my hand so I can update the docs?
I'll leave this thread open if someone in some way manages to build it under windows.
Ok for a Windows port but for cmd.exe or powershell ?
@x-a-n-a-x This is probably the least of your concerns. The really hard part would be to port qtermwidget under windows.
Anybody who’d like to implement a similar experience on Windows had better look at ConEmu and/or Console. They do much of the machinery needed to customize the console window; you will only need to augment the renderer.
If somebody is interested, I started a project based on qmltermwidget and libqxt which allows to open an ssh terminal on Windows (https://github.com/majuca/qssh). It is only a first draft but an ssh connection can be establish sucessfully.
Actually I was able to compile both qtermwidget and cool-retro-term under Windows by means of cygwin (with all qt5/qml deps). But sadly the exe didn't run with this error:
$ ./cool-retro-term.exe
QXcbConnection: Could not connect to display
Aborted (core dumped)
So I guess it's the Unix semantic missing :)
@neural75
Do you have any gui based program working through Cygwin? There is a way to send the output of a GUI to a different "screen". I forget exactly how that works... I suspect that is the key to this. See if you can get any gui launched first.
On Windows 7:
cd qmltermwidget
.qmake-qt5 && make
,make install
,cd ..
.qmake-qt5 && make
. (I had some clock skew errors in make which I'm not sure how to deal with, so I ignored them.)startxwin ./cool-retro-term.exe
in Cygwin terminalResults: Program opens a window, but you can't click or type in it. This prints in the terminal that the last startxwin command was ran in: https://gist.github.com/anne-decusatis/d2d4be8b5b01516b29793eb087909ad8
I'm concerned about a couple lines near the end:
Can't open a pseudo teletype
on line 63 andUnable to set terminal attributes.
on line 69.Most of the way there:

Yeah there's a problem compiling qmltermwidget/lib/kpty.cpp on Cygwin.
Basically, kpty provides platform-abstraction for all the various different ways the OS might support creating a TTY device pair on different systems. The module is falling back on the bad, old BSD-style method (opening all the /dev/pty* devices until it finds one it's able to open) which has been removed from most systems for years. That code should come with a great big warning message saying "your build settings are broken!" - because it's almost certainly not the code you want to be running. :)
You can correct that problem with a little change to qmltermwidget/qmltermwidget.pro:
-DEFINES += HAVE_POSIX_OPENPT HAVE_SYS_TIME_H
+DEFINES += _XOPEN_SOURCE=600 HAVE_POSIX_OPENPT HAVE_PTSNAME HAVE_SYS_TIME_H
kpty.cpp won't use posix_openpt() unless either HAVE_PTSNAME or TIOCGPTN are defined (this is what causes the fallback to the BSD-style method that doesn't work), and posix_openpt() won't appear in the Cygwin system headers unless you supply the _XOPEN_SOURCE define.
Unfortunately, after this change, it still doesn't appear to be working. The terminal opens the PTY device, and it runs bash with the PTY device as its controlling TTY, but I still don't get anything on the display (it looks just like Anne's screen shot), menu bars don't work, etc. I know a little QT but not really enough to readily diagnose this.
I'll get back to you guys if I'm able to work out the other issues. It really seems like we're close here...
(EDIT): Also, when I type commands into the terminal, they are executed! I can even close the session by typing "exit". I just don't see anything on the terminal window...
OK, I figured out the other problem... it's in kptydevice.cpp
There's a function KPtyDevicePrivate::_k_canRead(), which uses an ioctl() to try to determine if there's data available to read from the TTY device (data coming in from the shell process). The problem is, I think, that Cygwin doesn't support this particular ioctl.
At the top of the file the ioctl is defined as PTY_BYTES_AVAILABLE. On FreeBSD and Mac it's defined as TIOCOUTQ, otherwise it's set to TIOCINQ if it's defined, otherwise to FIONREAD.
I did a web search and apparently at one time TIOCINQ was defined in Cygwin but did not work correctly... I don't know if that's really still the case currently. But that's basically what seems to be happening. The ioctl() returns -1, signaling an error, and errno is set to "invalid argument" - which could mean the file descriptor is bad, but that's not the case...
I added code to my build to use poll() instead of the ioctl() - mainly to verify that the file descriptor really was valid - and got it working. The problem with my patch, though, is that the rest of the code in that function assumes that it will know not only that there is data in the input queue, but actually how much data is in the input queue... And poll() doesn't provide that, and I haven't yet rewritten the rest of the function... So I lie, I say I got a kilobyte. The rest of the function still works, it seems, even being lied to in this way. (It allocates a kilobyte, reads what it can, then shrinks the buffer... So wasteful!)
It's possible that there will actually be more than a kilobyte available: in which case the terminal may read the full 1K of data and not immediately be notified that there's more... I'll probably make more improvements to that function but for now I'm just happy that it works.

@zakukai Great! If you are confident with your changes we can create a custom branch on qmltermwidget including windows support and create an experimental CRT branch.
Well it's usable but it's not quite right yet. Among the issues I've noticed with my Windows build:
And ultimately I think we'd want my changes integrated a bit better (right now I just kind of gutted the things that were getting in my way) But it's a start. A branch is probably a good idea, make it easier for people to try it out, make it easier to make further changes, etc.
Is it possible to just port the visual part and attach it to ConEmu or console?
I'm sure it is.
...Let me know how that turns out. :)
Quick update from my end. I performed the necessary changes to the files that Zakukai suggested. I got it to work. But like Zakukai the menu shows up, but the menu under the main menus are not showing. I tried all kinds of different things, amoung those are:
I tried rolling the CRTMainMenuBar into main.qml, rem'ing it out in the resources.qrc file, but then it error'ed inside of PreprocessedTerminal.qml -- naturally because CRTMainMenuBar.qml isn't there. And then rem'ing it out inside of PreprocessedTerminal.qml didn't work. Which makes sense and doesn't. The MenuBar is encased inside of ApplicationWindow in main.qml, so it looks to me that with that being the case, the menubar should just get added.
I started thinking perhaps, the problem is the action is being used inside of CRTMainMenuBar.qml but it's not defined in that file, so rolling one of the actions (don't need all of them to test; just one) into that file and rem'ing out the rest in main.qml produced an error that basically stated that actions have to be encased in an ApplicationWindow tag. So that wasn't going to work.
I started thinking, maybe because it's placed inside of PreprocessedTerminal and the menubar are being overwritten with the graphical effects, which kind've makes sense. Originally if you clicked the menu, there would be a dark rectangle over the terminal portion of the screen where the menu would be. So I rem'ed out the adding of the menu bar in PreprocessedTerminal.qml and added the line:
CRTMainMenuBar{visible: true}
to TerminalContainer.qml line: 36 (inside the Loader figuring I'd have it render out-of-band from the graphical container (which it should and oddly enough it seems to load a bit faster this way for some reason; maybe it's just me), this was also a no-go.
Then I realized that was still under something that had to do with GFX (ShaderTerminal) so I added the line to main.qml instead (line: 241 - under Loader), this still didn't work.
It should be noted during these attempts, the MenuItem's were converted from actions to actual Menuitems. I.e. instead of MenuItem {action: quitAction}
I changed it to something like:
MenuItem
{
//id: quitAction
text: qsTr("Quit")
enabled: true
visible: true
shortcut: "Ctrl+Shift+Q"
onTriggered: Qt.quit();
}
just to make sure there wasn't any funny business with action types not being called-in/injected and I figured function like Qt.quit(); is an easy function, it's something built-in, it's not a dependence on a function defined in another file.
This is starting to look more and more like something screwed up with the QT library pulled down from CygWin64. I mean it wouldn't be the first issue with the QT library (i.e. someone spelling Accessibility as Acccessibility -- an extra "c"; there's a bug report on it even. Don't have the link handy though). I'd be curious to know where to rem out to prevent the graphical portion of the code from loading (even if it does render just an empty black/white window) just to see if the menu shows up and is function. If that's the case then we could probably eliminate the QT library deployed by CygWin64 as the culprit and move further down the line in the CRT qml code.
I know this sort of is a different way of going about this - but I was able to compile without changes in the linux subsystem for windows 10. xming provides the x environment with gl support. It has the same problems other folks are encountering, namely no actual terminal pipe.
Can confirm what @aaronsb has found, except I didn't compile it, but just installed it from the PPA using the subsystem. Same errors.
Also confirmed the case @aaronsb and @dvdmuckle experienced when building and running on subsystem using an x11 server.
Regarding my previous diff, the use of poll() and all that:
I noted in a previous post that one of the problems is that a certain ioctl() constant, TIOCINQ is defined in the Cygwin headers but not properly implemented in Cygwin, and that the code would fall back to another ioctl() constant, FIONREAD if TIOCINQ was not defined...
So, in fact, all that stuff I did with poll() was entirely unnecessary. All you really need to fix that bit of code in lib/kptydevice.cpp is to undefine TIOCINQ if it's a Cygwin system, and then go ask the Cygwin team how many years they're going to leave that ioctl broken. :)
I'd really like to know what's causing the program to freeze. It seems to happen when the terminal is left idle (or obscured?) for a certain amount of time. After a little while, the terminal stops animating, and a few minutes after that, it just seizes up. I've been hoping to get in there with a debugger and figure out what's going wrong, but so far the debugger's not giving me any useful answers.
When I have some time I'll try to clean up and simplify my patches and we can create that Windows branch. Hopefully from there we can move on to solving some of the other problems.
Hope you guys could make a Windows version of this great software! Looking forward to this!
I'm looking forward to this, too. If I can be of any help, just let me know.
If you want to help, get the source code, apply the patches, build and run the program on your machine... And then if you get that far, try to figure out why the program is locking up. I haven't spent a whole lot of time digging into that problem yet, it is probably the most important issue standing in the way of this being usable on Windows at this point.
I don't know if this can help, I found out something with tmux, Xming and WSL :
I started two bash in separated console, one to start
tmux
, the second to startcool-retro-term -e tmux attach
. The result are that you can clearly see that the process is correctly attached and you can clearly see that any sent key is correctly received by tmux, only the part of "printing the information back" does not work.@zakukai I know this was over 11 months ago, but I'm just trying to convert this project over and I was able to build out the retro term, I was thinking I would just pipe in commands to the console / terminal Gui.
The issue is, I can't seem to build the slots to render text to, is there any repo I can jump off that you guys have pushed to get these changes of yours?
I have cool-retro-term running mostly correctly on WSL with Xming.
It's not the most performant thing ever. Also occasionally it just up and dies on me. But most of the features work as intended. Running Windows 10 Enterprise 1803, build 17134.1.
I did not execute any additional patches or modifications to the current github source.
@aaronsb I was not able to type or click in the terminal using Xming when I tried it.
From a completely fresh WSL installation (ubuntu) on the mentioned windows version (10, enterprise, 17134.1)
The following commands seem to get required libraries, git clone, compile, and run a working instance of CRT. Now if windows would add support for running programs without an underlying bash prompt we'd be set.
@aaronsb Works for me, thanks.
@aaronsb I tried the last method and I got it to compile and load but no matter what i try to pipe to crt or use the -e option, I still can't get anything to show on the terminal, ideas?
@aaronsb I followed your steps to the letter. However at the very end it reports that it cannot output to "localhost:0".
@fullauto223cal Do you have an X server (like xming) running?
Thanks tovarish, working for me.
https://github.com/ArcticaProject/vcxsrv ?
Now that Windows has first-class support for third-party terminal emulators through ConPTY, I wonder if it's worth taking another look at this.
Not sure if it is the Intel graphics I'm using but I had to disable "Native opengl" in vcxsrv and
export LIBGL_ALWAYS_INDIRECT=0
for it to work. Otherwise it is either a black screen or won't start.It uses over 20% of the CPU constantly but LOOKS SO COOL!!! Worth every percent!
On Windows I think the closest look is hyper-postprocessing, a plugin for hyper terminal.
I also forked it and added an amber style looking for a balance between readability, performance, and "coolness".
Currently there is an issue with "inconsistent sharpness" of the texts on Windows and Linux. Other than that it's perfect...
The new Microsoft Terminal is open source. This lends nicely to extension, like a Cool Retro Term plugin.
https://github.com/microsoft/terminal/releases
Is this an unreachable dream?
I don't see why: I made some changes and got it working in Cygwin (see my patches above) - but there are still problems with it (freezes and menu failures, etc.), and I haven't been able to take the time to find solutions to those problems. The problems are definitely solveable...
Looking forward for a proper Windows port.
WSLg is available on Insider builds of windows, if it works there (It should, but I haven't tried) a windows port is no longer necessary.
@AlexAegis I don't think that installing linux is the answer to running on windows. That's like creating a jungle so you can eat a banana. I just tried doing this and it's a terrible long experience that results in gigs of wasted space to run a 32MB program. In the end I got a blank X window. Didn't even get as far as some others in this thread.
I'm not talking about running it through an X server. That's not adequate as you won't get any GPU acceleration which is very much a necessary thing for this program. WSLg does enable GPU acceleration and let's you run grahical Linux programs on Windows like they were native. Yes, you do need to install a minimal distro "just to run a 32mb program" but it's still much easier than to port the whole thing over. At least it's something that you can do today.
@A9G-Data-Droid I tried it for you, it works, no surprise.

Join the insider dev channel, update, install the preview drivers (linked in the readme of wslg) then just install cool-retro-term in Ubuntu WSL, and there you go. Oh and you also have to update the mesa drivers inside the WSL distro to get opengl acceleration.
(The squares on the image are because I have rune symbols in my prompt and the default font - terminus I think - doesnt support them)
@AlexAegis That's cool that it shows up in the start menu. I like this tight integration. I was using the old version is would seem. I still want a native Windows program but this is certainly cool and retro and terminal.
I really with something became of this 7 years later. I'd love to use this as a terminal emulator on Windows that functions like the command prompt. But it's probably too much to ask for since it would require too much re-writing of code designed for an operating system that functions in a very different way from Windows. I guess all we can hope for is a different terminal emulator which looks like CRT to come along for Windows. Or just enjoy it on Mac or Linux.
So there is a retro pixel shader in Windows Terminal now. It's not as good but it's a place where maybe the cool retro term style could be applied:
fb597ed304/samples/PixelShaders/Retro.hlsl
Has anyone tried compiling this with MSYS2 (Mingw)