Skip to content

Commit

Permalink
Merge branch 'Eugeny:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
wljince007 committed Jul 29, 2023
2 parents 4e4c9b7 + 0101ffd commit 8efc8c9
Show file tree
Hide file tree
Showing 31 changed files with 632 additions and 501 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPSTORE_USERNAME: ${{ secrets.APPSTORE_USERNAME }}
APPSTORE_PASSWORD: ${{ secrets.APPSTORE_PASSWORD }}
USE_HARD_LINKS: false
Expand Down Expand Up @@ -137,7 +138,7 @@ jobs:
- build-arch: arm64
arch: arm64
triplet: aarch64-linux-gnu-
- build-arch: arm
- build-arch: arm
arch: armhf
triplet: arm-linux-gnueabihf-
env:
Expand All @@ -152,7 +153,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Node
uses: actions/[email protected]
with:
Expand All @@ -161,14 +162,14 @@ jobs:
- name: Install deps (amd64)
run: |
sudo apt-get update
sudo apt-get install libarchive-tools zsh
sudo apt-get install libarchive-tools zsh
- name: Install npm_modules (amd64)
run: |
npm i -g yarn
yarn --network-timeout 1000000
if: matrix.build-arch == 'x64'

- name: Setup Crossbuild (${{matrix.arch}})
run: |
sudo apt-get update -y && sudo apt-get install schroot sbuild debootstrap -y
Expand All @@ -184,7 +185,7 @@ jobs:
root-groups=root,sudo
profile=buildd
personality=linux
union-type=overlay" | sudo tee /etc/schroot/chroot.d/build-chroot.pref >/dev/null
union-type=overlay" | sudo tee /etc/schroot/chroot.d/build-chroot.pref >/dev/null
echo "/home /home none rw,bind 0 0" | sudo tee -a /etc/schroot/buildd/fstab >/dev/null
if: matrix.build-arch != 'x64'
Expand All @@ -194,7 +195,7 @@ jobs:
sudo schroot -c build-chroot -u root -- bash -c "apt-get update -y
dpkg --add-architecture ${{matrix.arch}}
apt-get install -y nodejs libfontconfig-dev:${{matrix.arch}} libsecret-1-dev:${{matrix.arch}} libnss3:${{matrix.arch}} libatk1.0-0:${{matrix.arch}} libatk-bridge2.0-0:${{matrix.arch}} libgdk-pixbuf2.0-0:${{matrix.arch}} libgtk-3-0:${{matrix.arch}} libgbm1:${{matrix.arch}}
export CC=${{matrix.triplet}}gcc CXX=${{matrix.triplet}}g++ LD=${{matrix.triplet}}ld
export CC=${{matrix.triplet}}gcc CXX=${{matrix.triplet}}g++ LD=${{matrix.triplet}}ld
if [[ ${{matrix.arch}} == 'arm64' ]]; then
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/aarch64-linux-gnu/pkgconfig/
elif [[ ${{matrix.arch}} == 'armhf' ]]; then
Expand All @@ -210,15 +211,15 @@ jobs:

- name: Prepackage plugins (${{matrix.arch}})
run: scripts/prepackage-plugins.mjs

- name: Build packages (${{matrix.arch}})
run: scripts/build-linux.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
USE_HARD_LINKS: false
# DEBUG: electron-builder,electron-builder:*

- name: Build web resources
run: zsh -c 'tar czf tabby-web.tar.gz (tabby-*|web)/dist'
if: matrix.build-arch == 'x64'
Expand Down Expand Up @@ -294,7 +295,7 @@ jobs:
with:
name: Linux AppImage (${{matrix.arch}})
path: dist/*.AppImage

- uses: actions/upload-artifact@master
name: Upload DEB (${{matrix.arch}})
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This README is also available in: <a href="./README.es-ES.md">:es: Spanish</a>

----

[**Tabby**](https://tabby.sh) (formerly **Terminus**) is a highly configurable terminal emulator, SSH and serial client for Windows, macOS and Linux
[**Tabby**](https://tabby.sh) (formerly **Terminus**) is a highly configurable terminal emulator, SSH and serial client for Windows 10, macOS and Linux

* Integrated SSH and Telnet client and connection manager
* Integrated serial terminal
Expand Down
2 changes: 1 addition & 1 deletion app/lib/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ export class Window {
this.window.on('resize', onBoundsChange)

ipcMain.on('window-set-traffic-light-position', (_event, x, y) => {
this.window.setTrafficLightPosition({ x, y })
this.window.setWindowButtonPosition({ x, y })
})

ipcMain.on('window-set-opacity', (_event, opacity) => {
Expand Down
16 changes: 0 additions & 16 deletions build/mac/afterBuildHook.cjs

This file was deleted.

35 changes: 0 additions & 35 deletions build/mac/afterSignHook.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ appId: org.tabby
productName: Tabby
compression: normal
npmRebuild: false
afterSign: "./build/mac/afterSignHook.cjs"
afterAllArtifactBuild: "./build/mac/afterBuildHook.cjs"
files:
- '**/*'
- dist
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff --git a/node_modules/app-builder-lib/out/appInfo.js b/node_modules/app-builder-lib/out/appInfo.js
index 363f32c..a0434a9 100644
index 49f6dca..0ea11f2 100644
--- a/node_modules/app-builder-lib/out/appInfo.js
+++ b/node_modules/app-builder-lib/out/appInfo.js
@@ -100,9 +100,7 @@ class AppInfo {
@@ -112,9 +112,7 @@ class AppInfo {
return this.info.metadata.name;
}
get linuxPackageName() {
- const name = this.name;
- // https://github.com/electron-userland/electron-builder/issues/2963
- return name.startsWith("@") ? this.sanitizedProductName : name;
+ return 'tabby-terminal'
+ return 'tabby-terminal';
}
get sanitizedName() {
return filename_1.sanitizeFileName(this.name);
return (0, filename_1.sanitizeFileName)(this.name);
7 changes: 7 additions & 0 deletions scripts/build-macos.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ if (process.env.GITHUB_HEAD_REF) {
process.env.CSC_IDENTITY_AUTO_DISCOVERY = 'false'
}

process.env.APPLE_ID ??= process.env.APPSTORE_USERNAME
process.env.APPLE_APP_SPECIFIC_PASSWORD ??= process.env.APPSTORE_PASSWORD

builder({
dir: true,
mac: ['pkg', 'zip'],
Expand All @@ -24,6 +27,10 @@ builder({
},
mac: {
identity: !process.env.CI || process.env.CSC_LINK ? undefined : null,
notarize: process.env.APPLE_TEAM_ID ? {
appBundleId: 'org.tabby',
teamId: process.env.APPLE_TEAM_ID,
} : false,
},
npmRebuild: process.env.ARCH !== 'arm64',
publish: process.env.KEYGEN_TOKEN ? [
Expand Down
8 changes: 8 additions & 0 deletions tabby-core/src/api/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,18 @@ export interface FileUploadOptions {
multiple: boolean
}

export type PlatformTheme = 'light'|'dark'

export abstract class PlatformService {
supportsWindowControls = false

get fileTransferStarted$ (): Observable<FileTransfer> { return this.fileTransferStarted }
get displayMetricsChanged$ (): Observable<void> { return this.displayMetricsChanged }
get themeChanged$ (): Observable<PlatformTheme> { return this.themeChanged }

protected fileTransferStarted = new Subject<FileTransfer>()
protected displayMetricsChanged = new Subject<void>()
protected themeChanged = new Subject<PlatformTheme>()

abstract readClipboard (): string
abstract setClipboard (content: ClipboardContent): void
Expand Down Expand Up @@ -169,6 +173,10 @@ export abstract class PlatformService {
throw new Error('Not implemented')
}

getTheme (): PlatformTheme {
return 'dark'
}

abstract getOSRelease (): string
abstract getAppVersion (): string
abstract openExternal (url: string): void
Expand Down
9 changes: 5 additions & 4 deletions tabby-core/src/components/selectorModal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ export class SelectorModalComponent<T> {
{ sort: true },
).search(f)

const freeOption = this.options.find(x => x.freeInputPattern)
if (freeOption && !this.filteredOptions.includes(freeOption)) {
this.filteredOptions.push(freeOption)
}
this.options.filter(x => x.freeInputPattern).forEach(freeOption => {
if (!this.filteredOptions.includes(freeOption)) {
this.filteredOptions.push(freeOption)
}
})
}
this.selectedIndex = Math.max(0, this.selectedIndex)
this.selectedIndex = Math.min(this.filteredOptions.length - 1, this.selectedIndex)
Expand Down
3 changes: 2 additions & 1 deletion tabby-core/src/configDefaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ appearance:
tabsLocation: top
tabsInFullscreen: false
cycleTabs: true
theme: Standard
theme: Follow the color scheme
frame: thin
css: '/* * { color: blue !important; } */'
opacity: 1.0
Expand Down Expand Up @@ -54,3 +54,4 @@ hacks:
disableVibrancyWhileDragging: false
enableFluentBackground: false
language: null
defaultQuickConnectProvider: "ssh"
1 change: 1 addition & 0 deletions tabby-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export default class AppModule { // eslint-disable-line @typescript-eslint/no-ex
name: this.translate.instant('Quick connect'),
freeInputPattern: this.translate.instant('Connect to "%s"...'),
icon: 'fas fa-arrow-right',
description: `(${provider.name.toUpperCase()})`,
callback: query => {
const p = provider.quickConnect(query)
if (p) {
Expand Down
9 changes: 6 additions & 3 deletions tabby-core/src/services/profiles.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,20 @@ export class ProfilesService {
})
} catch { }

if (this.getProviders().some(x => x.supportsQuickConnect)) {
this.getProviders().filter(x => x.supportsQuickConnect).forEach(provider => {
options.push({
name: this.translate.instant('Quick connect'),
freeInputPattern: this.translate.instant('Connect to "%s"...'),
description: `(${provider.name.toUpperCase()})`,
icon: 'fas fa-arrow-right',
weight: provider.id !== this.config.store.defaultQuickConnectProvider ? 1 : 0,
callback: query => {
const profile = this.quickConnect(query)
const profile = provider.quickConnect(query)
resolve(profile)
},
})
}
})

await this.selector.show(this.translate.instant('Select profile or enter an address'), options)
} catch (err) {
reject(err)
Expand Down
23 changes: 20 additions & 3 deletions tabby-core/src/services/themes.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Subject, Observable } from 'rxjs'
import * as Color from 'color'
import { ConfigService } from '../services/config.service'
import { Theme } from '../api/theme'
import { PlatformService } from '../api/platform'
import { NewTheme } from '../theme'

@Injectable({ providedIn: 'root' })
Expand All @@ -17,13 +18,18 @@ export class ThemesService {
private constructor (
private config: ConfigService,
private standardTheme: NewTheme,
private platform: PlatformService,
@Inject(Theme) private themes: Theme[],
) {
this.rootElementStyleBackup = document.documentElement.style.cssText
this.applyTheme(standardTheme)
config.ready$.toPromise().then(() => {
this.applyCurrentTheme()
this.applyThemeVariables()
platform.themeChanged$.subscribe(() => {
this.applyCurrentTheme()
this.applyThemeVariables()
})
config.changed$.subscribe(() => {
this.applyCurrentTheme()
this.applyThemeVariables()
Expand All @@ -36,7 +42,7 @@ export class ThemesService {
document.documentElement.style.cssText = this.rootElementStyleBackup
}

const theme = this.config.store.terminal.colorScheme
const theme = this._getActiveColorScheme()
const isDark = Color(theme.background).luminosity() < Color(theme.foreground).luminosity()

function more (some, factor) {
Expand Down Expand Up @@ -106,8 +112,10 @@ export class ThemesService {

const themeColors = {
primary: theme.colors[accentIndex],
secondary: less(theme.background, 0.5).string(),
tertiary: theme.colors[8],
secondary: isDark
? less(theme.background, 0.5).string()
: less(theme.background, 0.125).string(),
tertiary: more(theme.background, 0.75).string(),
warning: theme.colors[3],
danger: theme.colors[1],
success: theme.colors[2],
Expand Down Expand Up @@ -184,6 +192,15 @@ export class ThemesService {
return this.findTheme(this.config.store.appearance.theme) ?? this.standardTheme
}

/// @hidden
_getActiveColorScheme (): any {
if (this.platform.getTheme() === 'light') {
return this.config.store.terminal.lightColorScheme
} else {
return this.config.store.terminal.colorScheme
}
}

applyTheme (theme: Theme): void {
if (!this.styleElement) {
this.styleElement = document.createElement('style')
Expand Down
6 changes: 3 additions & 3 deletions tabby-core/src/theme.new.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ body {
}

.nav {
--bs-nav-link-color: var(--theme-fg);
--bs-nav-link-color: var(--theme-fg-more);
--bs-nav-link-hover-color: var(--theme-fg-less);
--bs-nav-link-disabled-color: var(--bs-gray);
}
Expand All @@ -119,8 +119,8 @@ body {
--bs-nav-tabs-border-width: 2px;
--bs-nav-tabs-border-radius: 0;
--bs-nav-tabs-link-hover-border-color: var(--bs-body-bg);
--bs-nav-tabs-border-color: var(--theme-fg-less-2);
--bs-nav-tabs-link-active-color: var(--theme-fg-less-2);
--bs-nav-tabs-border-color: var(--theme-fg);
--bs-nav-tabs-link-active-color: var(--theme-fg);

--bs-nav-tabs-link-active-bg: transparent;
--bs-nav-tabs-link-active-border-color: transparent;
Expand Down
Loading

0 comments on commit 8efc8c9

Please sign in to comment.