Swordfish90 / cool-retro-term

A good looking terminal emulator which mimics the old cathode display...
22.03k stars 839 forks source link

Builds for native Apple silicon #656

Open sam1am opened 3 years ago

sam1am commented 3 years ago

Native builds for Apple silicon.

simonSlamka commented 3 years ago

+1 on this

radnor commented 2 years ago

You can do this yourself by following one of the items under Build instructions.

The only modification you'll need to do is adding a copy command (copied from #587) to address missing files in QMLTermWidget:

mkdir cool-retro-term.app/Contents/PlugIns
cp -r qmltermwidget/src/qmldir qmltermwidget/lib/kb-layouts qmltermwidget/lib/color-schemes qmltermwidget/src/QMLTermScrollbar.qml qmltermwidget/QMLTermWidget
cp -r qmltermwidget/QMLTermWidget cool-retro-term.app/Contents/PlugIns
open cool-retro-term.app
wjwOffline commented 2 years ago

any one need a native build?I have build a dmg use qt 5.15.5

simonSlamka commented 2 years ago

any one need a native build?I have build a dmg use qt 5.15.5

Is it signed?

wjwOffline commented 2 years ago

sorry, I haven't register the Apple Developer Program,you can build it with qt 5.15.5 for yourself , it works.

Mario-SO commented 1 year ago

Could you share it please?

Justtheflu commented 1 year ago

any one need a native build?I have build a dmg use qt 5.15.5

yes please.

ngocphamm commented 1 year ago

I was able to build in on Ventura 13.1 with Qt installed via brew install qt@5 (version 5.15.7 as of now) using the original instructions. I found out I didn't have to copy those extra files like what @radnor said, and the app still runs.

cp -r qmltermwidget/src/qmldir qmltermwidget/lib/kb-layouts qmltermwidget/lib/color-schemes qmltermwidget/src/QMLTermScrollbar.qml qmltermwidget/QMLTermWidget.

However, I found some issues with some special characters I use for my ZSH prompt, like », , etc.

It renders fine (below) if

It does not render the chracters if I run it directly (double click the app, or via Spotlight/Alfred launcher).

This somehow seems like a shell issue, but I have no idea where to start yet. It also does not happen on my Intel mac.

CleanShot 2022-12-27 at 11 53 39

axxyhtrx commented 1 year ago

UP

iamthebot commented 12 months ago

@ngocpham just created #809 to track this issue (powerline fonts broken).

IgorMuzyka commented 10 months ago

On macOS 14.1 Sonoma. Just built it trying what @radnor suggested. Installed qt via brew by doing brew install qt5 & brew link qt5 --force and applying suggested change(export PATH="/opt/homebrew/opt/qt@5/bin:$PATH") to .zshrc. At first font's were broken, but then i did macdeployqt cool-retro-term.app -qmldir=app/qml -dmg as build instructions suggest. Which actually breaks the resulting .app inside the .dmg for me. But after doing this 3-5 times and then skipping macdeployqt step i finally got it working.

Seems to me that macdeployqt does some crucial step, so building after running it again gave me a working variation where font's arrent bugged.

Here's a proof screenshot.

screenshot 2023-11-01 at 07 20 14

By the way i'm using monospaced MesloLGMDZ Nerd Font Mono which is icon patched version of Menlo. You can see icons are fine and starship.rs prompt isn't glitched or missing. Also you may see that architecture is arm64 which indicates that i indeed just built this and it isn't running in Rosetta mode as version from releases page.

@ngocphamm @iamthebot i believe #809 is a false positive, and build instructions can probably be adapted to reproduce working app every time.

Just noticed:

runofthemillgeek commented 6 months ago

I narrowed this down to the env variable that's needed to avoid breaking the font—LC_CTYPE.

You can simulate the "no icons" condition by running:

env -i open cool-retro-term.app

and it will load without icons as if it were launched directly from Finder. But if I run:

env -i "LC_CTYPE=UTF-8" open cool-retro-term.app

then the icons appear as expected.

I thought the following should account for this but it doesn't seem to be. I installed Qt 5.15.12 via brew, so maybe this isn't getting set when pre-processing?

https://github.com/Swordfish90/cool-retro-term/blob/f157648d1e51878a10e02a8836c1e15aa8c59cc9/app/main.cpp#L45-L48

Anyway, to set this variable globally at least on newer macOS versions (I'm using Sonoma right now), you need to create a file /Library/LaunchDaemons/setenv.LC_CTYPE.plist with the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"\>
  <plist version="1.0">
  <dict>
  <key>Label</key>
  <string>setenv.LC_CTYPE</string>
  <key>ProgramArguments</key>
  <array>
    <string>/bin/launchctl</string>
    <string>setenv</string>
    <string>LC_CTYPE</string>
    <string>UTF-8</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>ServiceIPC</key>
  <false/>
</dict>
</plist>

Save it. Then run the following command for this to take effect globally even after reboots:

launchctl load -w /Library/LaunchDaemons/setenv.LC_CTYPE.plist

Now if you open the app directly from Finder or from Spotlight, it'll load fonts correctly.

CleanShot 2024-02-03 at 02 28 18@2x

runofthemillgeek commented 2 months ago

Looks like launchctl load gets reset if you upgrade the OS. Have to run it again.