Port cool-old-term to OSX #12
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?
On behalf of all MacOSX users - could you please add it to Homebrew?
Thanks!
Sadly I don't have a Mac and nor any knowledge related to Homebrew... Anyhow did anyone tried if this is is working on OSX?
I tried and got an error relating to KDE, I didn't delve into installing KDE on OSX.
file:///Users/moss/code/cool-old-term/app/main.qml:26 module "org.kde.konsole" is not installed
I believe this is inappropriate for homebrew. For OSX, the correct thing would be to package as an app, not as a command-line executable in /usr/local/
https://github.com/Homebrew/homebrew/wiki/Acceptable-Formulae
This software has absolutely no dependencies with KDE and the Konsole plugin is self contained.
The error you see happens because qmlscene can't locate the plugin. This could be caused by a build error (please paste the output of qmake && make && make install) or by a problem with the path.
I will leave this thread open if we have any news on cool-old-term on OSX. The problem of packaging it will be relevant only afterward.
I guess it's better to make a dmg instead, since installing qt and xcode on the machine will eat up to 10gb. A weekend project?! ;)
the project isn't compiled currently on macos 10.9 qt 5.3.1
see make log: https://gist.github.com/razum2um/0d40e89f3eddb2a5c8b5
Hello, I am having the same errors as razum2um. Can anyone help please? :(
when I compile it I get the exact same errors as razum2um
http://dpaste.com/15Y2F3X
I might try to get this working on the weekend if i can find the time to do so.
Mac users can look at http://www.secretgeometry.com/apps/cathode/ while they wait. =)
nice find ways.
The same issues on OS X
OS X 10.9.4, Qt 5.3.1
https://gist.github.com/AYastrebov/70e015ff49a5165fcfeb
One of the problems is that setutent() is not supported on BSD platforms, such as OS X. So one must manually open _PATH_UTMP etc. instead of using setutent(), if I don't recall wrong.
Look at the getutent()/setutent() routines in this file for example: http://ftp.ics.uci.edu/pub/centos0/ics-custom-build/BUILD/rsyslog-3.19.8/tools/omusrmsg.c
Can the missing functions be added for compatibility? It seems to have worked for this project: https://trac.osgeo.org/qgis/ticket/2021
OK, I followed guitorri suggestion and I was able to compile everything. However, I could not pass through linking phase. I get the following error:
Undefined symbols for architecture x86_64:
"KTerminalDisplay::banana(int, int, int, int)", referenced from:
KTerminalDisplay::qt_static_metacall(QObject_, QMetaObject::Call, int, void_*) in moc_TerminalDisplay.o
Indeed, I can see there's the declaration of the method called "banana" (What the hell is that btw??)
in file TerminalDisplay.h, although it is NOT implemented anywhere in TerminalDisplay.cpp. I wonder how this worked fine when I compiled this same application on Linux Mint. Does anyone have any ideas?
Actually, I know this is wrong but I did the following workaround: I simply put a dummy method banana in TerminalDisplay.cpp. Compiled again and it created the executable. The result is the file I attached. The terminal is all blurry, I can't read anything from it... Hope this helped you guys understand a little bit better what is missing.
Nice @aacalfa !
Can you share the changes you did so far?
Ahahah... When I experiment I sometimes use names of fruits that's definitely my bad!... It is really strange that this doesn't appear among the warnings in linux. Will fix that!
Anyway what you see is a huge progress. The blurriness is due to the fact that the main terminal is not drawn, but only the bloom effect. This means that the terminal itself works so maybe the c++ side is fine but there is a problem with one of the shaders. Can you post the output of the application?
Here are my changes:
c612a1d586
The output is this: Using an unsupported variable-width font in the terminal. This may produce display errors.
loadAllColorSchemes
Using an unsupported variable-width font in the terminal. This may produce display errors.
qml: Loading settings: {"fontIndexes":[0,2,0],"fontScalingIndexes":[5,1,1],"fps":0,"frameReflections":true,"show_terminal_size":true,"window_scaling":1}{"ambient_light":0.2,"background_color":"#000000","bloom_strength":0.5,"brightness":0.5,"brightness_flickering":0.2,"contrast":0.85,"fontIndex":2,"font_color":"#2fff91","frames_index":1,"glowing_line_strength":0.22,"horizontal_sincronization":0.08,"jitter":0.1,"motion_blur":0.65,"noise_strength":0.08,"rasterization":1,"screen_distortion":0.18,"windowOpacity":1}
QOpenGLFramebufferObject: Unsupported framebuffer format.
QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
QOpenGLFramebufferObject: Unsupported framebuffer format.
QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
QOpenGLFramebufferObject: Unsupported framebuffer format.
QOpenGLFramebufferObject: Framebuffer incomplete, missing attachment.
Ok good... Sadly I have no time right now. But open the file PreprocessedTerminal.qml and comment all the lines: format: ShaderEffectSource.Alpha (there should be three of them).
It might be necessary to wrap the compatibility functions to avoid redefinition errors.
Something like:
I'm getting Qt5 to see if I can help further...
IT WORKED! Thanks Swordfish90. I just commented those 3 lines and here's the result!!
I also pushed it to my version:
d063e888a3
Soooo coool! Can't wait to build it. Nice job @aacalfa ! 👍
Thank you very much for your contribution @aacalfa ... In just a day we have a working version for OSX. Awesome! When you are done please make a pull request (without the workaround, this issue seems more hardware/opengl related, so it needs a proper fix) and I will happily integrate that.
Thanks again.
No problem @Swordifish90 , I am really happy that I could help you with that! I don't really get what you mean though. Without which workaround? I'll list everything I did:
1 - Modified kpty.cpp, by putting the implementations of utmp.h functions.
2 - Created a dummy banana method to get through linking.
3 - Commented the 3 ShaderEffectSource.Alpha occurrences in PreprocessedTerminal.qml
Which workarounds do you mean?
Done :)
Oh btw I see only one bug so far.As you can see from the last picture I uploaded, the terminal is not printing my current directory, it always print bash3.2$
What could it be?
The patch @aacalfa is now online in the osx branch: https://github.com/Swordifish90/cool-old-term/tree/osx . Please test it and let me know if it's safe to merge it in master. Thank you again @aacalfa and all the others.
@aacalfa No Idea why they behave differently. Will check that maybe next week.
Makefile within
konsole-qml-plugin
folder is created on linux box, and compilation fails:Should it be removed?
With that Makefile removed compilation still fails: https://gist.github.com/e1senh0rn/fc3bb3a3277bb6b29cc2
@e1senh0rn by running qmake it will generate the proper Makefile, so that you may run make and then make install. Did you follow the directions from Readme and put your qmake executable in $PATH? The command you wrote lists 2 different qmake paths, /usr/local/opt/qt5/bin/qmake and /usr/lib/x86_64-linux-gnu/qt5/bin/qmake. I believe there's something wrong there.
This is what I am saying. There is linux-generated Makefile in the repo.
Ok I guess you should disregard this Makefile that came with the checkout. The errors you got when you created the Makefile yourself and built are kinda odd. Do you have OS X 10.9 and Xcode command line tools installed? All the errors you got when compiling utmpmac.cpp mean that your build had not included the following headers:
#include <cstdio> #include <cstdlib> #include <cstring> #include <unistd.h> #include <limits.h> #include <fcntl.h> #include <sys/stat.h>
When I first created utmpmac.cpp, I had the same errors as you did, so I started including these files and the errors started to disappear. Can you verify that you indeed have those headers and that they were correctly included in your build?
Yes, I have headers you did mention.
I tried to include them into "utmpmac.h", and got past that error. Sadly, there is another one: https://gist.github.com/e1senh0rn/812d01bdddd41a2939ec
Hmm actually it is probably a better idea to put them in utmpmac.h file. I don't understand why your build procedure tried to access a file called app.pro. I don't have it here... Can you see anything suspicious in your Makefile?
I believe it is because of what is specified within cool-old-term.pro in SUBDIRS variable. From what I see in qmake description,
So even
make clean
tries to useapp/app.pro
. Removingapp
directory from there allowed it to successfully finish build.Still, after building I cannot run it:
I don't think you should do that. It was actually not a successful build.
I'm really sorry but my knowledge on Qt stuff is very limited. Hope someone can help you right away 👍
I'll keep digging. Thank you!
Ok, silly me - I didn't execute
make install
, so there was noimports
dir. It works and looks awesome! I'll send all the corrections in a PR later today.haha great to know! Well done :)
@aacalfa thanks for the hint. Adding the headers allowed the compilation. Nice :)
Hi everyone, the last pull request has been merged in branch osx. I tried it on linux and as expected there were no problems. So let me know if we are ready to merge it back to master. If so please also update the README with the instruction on how to build it for OSX (if there is anything specific), and maybe share a video to let me know how it looks under OSX, I'm curious :D . Thank you again to all the people helping with this!
@Swordifish90 It worked fine here, no adjustments necessary. I just would like to know if anyone else who managed to run it on OS X is getting the same bug as me by the terminal not showing my current directory, just "bash". I made a video https://www.youtube.com/watch?v=xcaGkmhcwL4 :)
Run this command.
@zathey nice! That did the trick. Anyway, before I type this command, if I type "whoami", it already shows correctly my username, so I am already logged in right? Still, this behavior doesn't make much sense...
The login command configures the environment. You will get a similar result when running
sudo bash
vs.sudo login -f root
in Terminal.Hmm I understand. But my point is that I also installed cool-old-term on Linux Mint and I don't need to do that. Maybe the implementation of utmp functions I introduced to osx branch are kinda buggy?
@aacalfa thank you for the video. It definitely looks nice!... Why are there no decorations on the main window? Is that something you set or is it the default look?
@Swordifish90 you mean the menu items "File", "Edit" and "View" at the top? They appear at the upper bar in OS X, that's common for any application.
@aacalfa no, I meant the top bar that is used to drag the application. The one with the close, maximize and minimize button to be clear. I can actually see only the content.
I do not get a top bar on the qmlscene window and the window is not draggable.
Ok. I don't know how QtQuick behaves under OSX but I think this is a problem we need to investigate. Do you see any error message qmlscene prints?
same problem with me actually. I usually work with fullscreen so I didn't really notice this, but I can't drag the window. The only message I get is "Using an unsupported variable-width font in the terminal. This may produce display errors."
Concerning the
utmp
functions. They have deprecation warnings written all over the OSX headers. There is a bunch of redefinitions to useutmpx
. Same goes forktpy.[h,c]
. Just mentioning in case it comes back...I don't know why on OSX behave differently (bash instead of path and username), but I would not be so sure it depends on those utmp functions.
With respect to missing title bar please try to play with the flags in app/main.qml.
Replace the line "flags: Qt.WA_TranslucentBackground" with other combinations such as:
flags: Qt.WA_TranslucentBackground | Qt.Window | Qt.WindowMinMaxButtonsHint | Qt.WindowFullscreenButtonHint | Qt.WindowCloseButtonHint
All the other possible flags are available here: http://qt-project.org/doc/qt-5/qt.html#WindowFlags-typedef
If that doesn't work try removing Qt.WA_TranslucentBackground and the line: "color: "#00000000".
I tried a lot of combinations and none of them worked. I ended up managing to put the window decoration though. You just need to comment the "flags:" (you don't need to comment "color"). Here's the result:

Qt currently has a lot of problems on OS X 10.10 (developer preview) so I don't think it would build there. Could anyone upload the built binary? It would be really cool to test this out.
It would also be great if we could use appdmg (https://github.com/LinusU/node-appdmg) to automatically build a
.dmg
directly frommake
. If someone who's good with graphics could make a "Drag to Applications to install" background for the image that would be awesome.@LinusU does
appdmg
handle the bundling and copying of Qt libraries? Otherwisemacdeployqt
which is already included on Qt should be the first alternative, IMHO.No, all it does is creating a
.dmg
image around a.app
file. I thought thatmacdeployqt
was used to get the.app
file (which really is a folder) and after thatappdmg
can be used to create thedmg
. Ifmacdeployqt
does everything then that sounds like the best solution.Yes
macdeployqt
has a-dmg
option. I don't know how nice the generated.dmg
looks compared toappdmg
. The thing is thatmacdeployqt
is not yet in use. The first thing is to create the Mac bundle and copy/deploy all the needed frameworks in there. Now there is just a bunch of.qml
files. I am not yet familiar with Qt5 and QML... Someone?hmm I built mine on 10.10 DP4
@vs37nx Where did you get
qmake
from? Did you maybe install QT thru homebrew before updating to 10.10?yeah I did
It seems that
utmpx
family of functions are available on Mac OS X. That's the first thing I have tried when started to build the project being incapable of handling my curiosity.Turning on
-DHAVE_UTMPX
, turning off-DHAVE_UPDWTMPX
in the autogenerated Makefile and replacing occasional accesses to aut_name
withut_user
in thekpty.cpp
were enough for me to make it work great, well if I could make such point yet considering my only 16 and counting minutes of overwhelming ecstasy.qt5
seems to be working on 10.10 now, hurray! I couldn't get the actual app to build though.I used the latest commit from @aacalfa's repository. @vs37nx which patches did you use to work around the
utmp
related problems?Scratch that, got it working! 🎆
brew install qt5
PATH=/usr/local/opt/qt5/bin:$PATH
.
qmake
void KTerminalDisplay::banana(int x, int y, int z, int w)
insrc/TerminalDisplay.cpp
main.qml:26 module "org.kde.konsole" is not installed
is fixed by runningmake install
insidekonsole-qml-plugin
.@aacalfa I think that simply commenting flags won't be a good solution. Transparency should not work anymore (surely not under linux).
Edit: I was wrong. Transparency works under linux even without flags. I think we are lucky enough and the solution is really to remove that line :D .
@Swordifish90 haha yeah well it still works in OS X too!
@LinusU With current master branch (#4a7e23), no need for steps 3, 4 and 5! Now it just works.
Cannot resize or move the window though. This is a very nice, super cool old terminal 😎
@Swordfish--THANK YOU! This is sweet--Atari ST page white. Any update on the move issue?

@lwdallas You are welcome!... The missing topbar feature has been fixed but I've never pushed the patch. I will do that as soon as I can. Moreover you will be happy to know that I purchased a macbook pro to replace my old laptop. So, even though I'm mainly using ubuntu on it, I can now be an active part in the OSX port process.
MacOSX appear to expect a different type of shell than Linux in general.
Linux: interactive, non-login
MacOSX: interactive, login
Reference: https://github.com/sstephenson/rbenv/wiki/Unix-shell-initialization
To patch for MacOSX:
Edit: konsole-qml-plugin/src/Session.cpp
Goto function "void Session::run()"
Right below "arguments << exec;"
Add the following two lines:
arguments.append("-i");
arguments.append("-l");
This tells the designated shell to start with -i (interactive), and -l (login).
For: konsole-qml-plugin, make clean;make;make install
For cool-retro-term, make clean;make;open ./cool-retro-term.app
ToDo: Add check to see if host is MacOSX and add the arguments dynamically on start if so (that or define during compile time).

Update:
Add the following below: "arguments << exec;"
"/usr/bin/sw_vers" is a MacOSX specific tool for reporting the OS version on the command line, it should only exist on such systems, so testing for it's presence is a good indicator of the system type we're running on. (if you rename the file and restart the app then it will assume non-apple and start without appending "-i -l" to the shell.)
Couldn't it be possible to use the
uname
function (uname(2))?Yes, and no, uname will return the kernel information such as what kernel are we running, nothing about the Distro.
MacOSX: uname -a
Darwin XXXHOSTNAMEXXX 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
The Darwin kernel however is not MacOSX, as Darwin can and is used for other distros besides MacOSX. I do not know if other Darwin based operating systems experience this same issue with login shells or not.
http://en.wikipedia.org/wiki/Darwin_(operating_system)
I do not think "-l -i" would interfere with other Darwin derivatives either, but I would rather not blanket all Darwin kernel systems the same way without testing and knowing for the same reason I would rather not append "-l -i" to all linux shells even though it would work.
Btw, the better way to define this is with compile time options to detect the OS and only enable the appends if the app was compiled (on/for?) MacOSX but I haven't tried that option yet. This is more of a hack to make it work when it should and not when it shouldn't for the time being.
Yeah, you are right, uname does not include the OS, it is just a GNU extension that the uname command prints GNU/Linu.x. However, I'm always for selecting the OS at compile-time.
@sirgatez Thank you for the suggestion. When I tested it I was forcing login with "login -f $USER" but this is way nicer. I agree that this should be decided at compile time and should not interfere with other OSs.
it built from the osx branch - very nice!
thanks, it works!
perhaps it should be noticed, that you must do "make install" but it would just copy console plugin in the right place, not touching the system
Could somebody make a DMG please? I tried installing qt5 and gave up after 1.5 hours of ./make... Thank you in advance!
Please, update to latest master branch
Yesterday, a patch has landed in master which makes crt build under osx with minimal changes (We are talking about 10 lines of code). So I suggest everyone from now on to take it directly from master. I'll leave the branch open until we take the good part from it.
We are talking about 10 lines of code.
Which changes need?
@miuirussia
a78231eac5
. Let's say that the previous solution was a little bit over-engineered :)With the latest master
08ade0eb6f
I find that I can't type anything except by copying from elsewhere and pasting using the menu. The last version I tried (4a7e23f024
) didn't have this issue.Hello everyone I think this ticked can be close right now. With the RC1 OS X support is finally complete.
https://github.com/Swordfish90/cool-retro-term/releases/tag/v1.0.0-RC1 (There is also a DMG file).
Thank you very much for all the people who helped with the porting!