Compare commits

..

18 Commits

Author SHA1 Message Date
allcontributors[bot]
008cae9710 update README.pt-BR.md [skip ci] 2024-07-10 08:52:38 +00:00
allcontributors[bot]
d38a900553 update README.id-ID.md [skip ci] 2024-07-10 08:51:34 +00:00
allcontributors[bot]
964cd482b2 update .all-contributorsrc [skip ci] 2024-07-10 08:51:30 +00:00
allcontributors[bot]
c127a00016 update README.de-DE.md [skip ci] 2024-07-10 08:50:54 +00:00
allcontributors[bot]
e857da28ac update README.it-IT.md [skip ci] 2024-07-10 08:50:53 +00:00
allcontributors[bot]
06b625cb6f update README.ko-KR.md [skip ci] 2024-07-10 08:50:52 +00:00
allcontributors[bot]
8e8cf6a500 update README.ru-RU.md [skip ci] 2024-07-10 08:50:51 +00:00
allcontributors[bot]
4930d0fac6 update README.zh-CN.md [skip ci] 2024-07-10 08:50:50 +00:00
allcontributors[bot]
ba31e14fa4 update README.md [skip ci] 2024-07-10 08:50:49 +00:00
Eugene
ff49b50d7d Merge pull request #9773 from GeminiLn/fix-issue-6467
Fix issue 6467: IP cannot be copied in SSH tab
2024-07-10 10:50:36 +02:00
GeminiLn
b436eac973 Fix: Ensure IP is selectable in SSH tab 2024-07-09 22:17:11 -07:00
GeminiLn
64195940a1 Fix: Ensure IP is selectable in SSH tab 2024-07-09 22:15:12 -07:00
Eugene
69dd2993af Merge pull request #9768 from Vadhvis/master
SSH Lag Fix
2024-07-09 11:45:27 +02:00
Vadhvis
2b65bb4b14 Linting Fix: Switch to function property 2024-07-09 11:39:37 +03:00
Vadhvis
4ed4d756c9 Remove semicolons 2024-07-09 11:32:02 +03:00
Vadhvis
fa9ee756d2 SSH Lag Fix 2024-07-09 11:21:35 +03:00
Eugene
223d8549ad Merge pull request #9749 from microhobby/wsl-icon
wsl: Get the distro icon from the package family name
2024-07-09 10:04:05 +02:00
Matheus Castello
1e6c2cba76 wsl: Get the distro icon from the package family name
All the WSL distributions that was installed from the Microsoft Store
have a package family name that can be used to get the icon of the
distribution.

Signed-off-by: Matheus Castello <matheus@castello.eng.br>
2024-07-01 12:26:28 -03:00
16 changed files with 85 additions and 4 deletions

View File

@@ -1301,6 +1301,15 @@
"contributions": [
"code"
]
},
{
"login": "GeminiLn",
"name": "Yu Qin",
"avatar_url": "https://avatars.githubusercontent.com/u/12425057?v=4",
"profile": "https://github.com/GeminiLn",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,

View File

@@ -339,6 +339,7 @@ Dank geht an diese wunderbaren Menschen ([emoji key](https://allcontributors.org
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://5k.work/"><img src="https://avatars.githubusercontent.com/u/82694310?v=4?s=100" width="100px;" alt="Mxmilu"/><br /><sub><b>Mxmilu</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=Mxmilu666" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cbuff.dev"><img src="https://avatars.githubusercontent.com/u/29805363?v=4?s=100" width="100px;" alt="Charles Buffington"/><br /><sub><b>Charles Buffington</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=C41M50N" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/GeminiLn"><img src="https://avatars.githubusercontent.com/u/12425057?v=4?s=100" width="100px;" alt="Yu Qin"/><br /><sub><b>Yu Qin</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=GeminiLn" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -338,6 +338,7 @@ Terima kasih kepada mereka yang telah membantu ([emoji key](https://allcontribut
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://5k.work/"><img src="https://avatars.githubusercontent.com/u/82694310?v=4?s=100" width="100px;" alt="Mxmilu"/><br /><sub><b>Mxmilu</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=Mxmilu666" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cbuff.dev"><img src="https://avatars.githubusercontent.com/u/29805363?v=4?s=100" width="100px;" alt="Charles Buffington"/><br /><sub><b>Charles Buffington</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=C41M50N" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/GeminiLn"><img src="https://avatars.githubusercontent.com/u/12425057?v=4?s=100" width="100px;" alt="Yu Qin"/><br /><sub><b>Yu Qin</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=GeminiLn" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -334,6 +334,7 @@ Grazie a queste persone meravigliose ([emoji key](https://allcontributors.org/do
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://5k.work/"><img src="https://avatars.githubusercontent.com/u/82694310?v=4?s=100" width="100px;" alt="Mxmilu"/><br /><sub><b>Mxmilu</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=Mxmilu666" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cbuff.dev"><img src="https://avatars.githubusercontent.com/u/29805363?v=4?s=100" width="100px;" alt="Charles Buffington"/><br /><sub><b>Charles Buffington</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=C41M50N" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/GeminiLn"><img src="https://avatars.githubusercontent.com/u/12425057?v=4?s=100" width="100px;" alt="Yu Qin"/><br /><sub><b>Yu Qin</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=GeminiLn" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -333,6 +333,7 @@ Pull requests and plugins are welcome!
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://5k.work/"><img src="https://avatars.githubusercontent.com/u/82694310?v=4?s=100" width="100px;" alt="Mxmilu"/><br /><sub><b>Mxmilu</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=Mxmilu666" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cbuff.dev"><img src="https://avatars.githubusercontent.com/u/29805363?v=4?s=100" width="100px;" alt="Charles Buffington"/><br /><sub><b>Charles Buffington</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=C41M50N" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/GeminiLn"><img src="https://avatars.githubusercontent.com/u/12425057?v=4?s=100" width="100px;" alt="Yu Qin"/><br /><sub><b>Yu Qin</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=GeminiLn" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -355,6 +355,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://5k.work/"><img src="https://avatars.githubusercontent.com/u/82694310?v=4?s=100" width="100px;" alt="Mxmilu"/><br /><sub><b>Mxmilu</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=Mxmilu666" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cbuff.dev"><img src="https://avatars.githubusercontent.com/u/29805363?v=4?s=100" width="100px;" alt="Charles Buffington"/><br /><sub><b>Charles Buffington</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=C41M50N" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/GeminiLn"><img src="https://avatars.githubusercontent.com/u/12425057?v=4?s=100" width="100px;" alt="Yu Qin"/><br /><sub><b>Yu Qin</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=GeminiLn" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -342,6 +342,7 @@ Obrigado vai para essas pessoas maravilhosas ([emoji key](https://allcontributor
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://5k.work/"><img src="https://avatars.githubusercontent.com/u/82694310?v=4?s=100" width="100px;" alt="Mxmilu"/><br /><sub><b>Mxmilu</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=Mxmilu666" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cbuff.dev"><img src="https://avatars.githubusercontent.com/u/29805363?v=4?s=100" width="100px;" alt="Charles Buffington"/><br /><sub><b>Charles Buffington</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=C41M50N" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/GeminiLn"><img src="https://avatars.githubusercontent.com/u/12425057?v=4?s=100" width="100px;" alt="Yu Qin"/><br /><sub><b>Yu Qin</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=GeminiLn" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -334,6 +334,7 @@ Pull-запросы и плагины приветствуются!
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://5k.work/"><img src="https://avatars.githubusercontent.com/u/82694310?v=4?s=100" width="100px;" alt="Mxmilu"/><br /><sub><b>Mxmilu</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=Mxmilu666" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cbuff.dev"><img src="https://avatars.githubusercontent.com/u/29805363?v=4?s=100" width="100px;" alt="Charles Buffington"/><br /><sub><b>Charles Buffington</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=C41M50N" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/GeminiLn"><img src="https://avatars.githubusercontent.com/u/12425057?v=4?s=100" width="100px;" alt="Yu Qin"/><br /><sub><b>Yu Qin</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=GeminiLn" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -333,6 +333,7 @@
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://5k.work/"><img src="https://avatars.githubusercontent.com/u/82694310?v=4?s=100" width="100px;" alt="Mxmilu"/><br /><sub><b>Mxmilu</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=Mxmilu666" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cbuff.dev"><img src="https://avatars.githubusercontent.com/u/29805363?v=4?s=100" width="100px;" alt="Charles Buffington"/><br /><sub><b>Charles Buffington</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=C41M50N" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/GeminiLn"><img src="https://avatars.githubusercontent.com/u/12425057?v=4?s=100" width="100px;" alt="Yu Qin"/><br /><sub><b>Yu Qin</b></sub></a><br /><a href="https://github.com/Eugeny/tabby/commits?author=GeminiLn" title="Code">💻</a></td>
</tr>
</tbody>
</table>

View File

@@ -24,6 +24,7 @@
"electron-updater": "^5.2.1",
"fontmanager-redux": "1.1.0",
"glasstron": "0.1.1",
"node-powershell": "5.0.1",
"js-yaml": "4.1.0",
"keytar": "^7.9.0",
"mz": "^2.7.0",

View File

@@ -1,7 +1,11 @@
.icon(
[fastHtmlBind]='pngPath',
*ngIf='!isHTML && isPNG'
)
i.icon(
class='fa-fw {{icon}}',
[style.color]='color',
*ngIf='!isHTML'
*ngIf='!isHTML && !isPNG'
)
.icon(
[fastHtmlBind]='icon',

View File

@@ -12,7 +12,15 @@ export class ProfileIconComponent extends BaseComponent {
@Input() icon?: string
@Input() color?: string
get pngPath (): string {
return `<img src="${this.icon?.trim()}" width="16" height="16" />`
}
get isHTML (): boolean {
return this.icon?.startsWith('<') ?? false
}
get isPNG (): boolean {
return this.icon?.endsWith('.png') ?? false
}
}

View File

@@ -6,6 +6,8 @@ import { HostAppService, Platform, isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG
import { ShellProvider, Shell } from 'tabby-local'
import { PowerShell } from 'node-powershell'
/* eslint-disable block-scoped-var */
try {
@@ -38,10 +40,42 @@ const wslIconMap: Record<string, string> = {
/** @hidden */
@Injectable()
export class WSLShellProvider extends ShellProvider {
private _pwsh: PowerShell
constructor (
private hostApp: HostAppService,
) {
super()
// make sure that this will not use the powershell profile
// that may take a long time to load
this._pwsh = new PowerShell({
executableOptions: {
'-NoProfile': true,
},
})
}
private async _resolveIcon (defaultDistKey: any): Promise<string> {
let _icon = wslIconMap.Linux
// check if the register has PackageFamilyName
if (defaultDistKey.PackageFamilyName) {
// get the icon from the package family name
const packageFamilyName = (defaultDistKey.PackageFamilyName.value as string).split('_')[0]
if (packageFamilyName) {
const _ret = await this._pwsh.invoke(`Get-AppxPackage ${packageFamilyName} | ConvertTo-Json`)
if (!_ret.hadErrors && _ret.stdout?.toString() !== undefined && _ret.stdout.toString() !== '') {
const appx = JSON.parse(_ret.stdout.toString())
const installationLocation = appx.InstallLocation
_icon = `${installationLocation}\\Assets\\Square44x44Logo.targetsize-16.png`
}
}
}
return _icon
}
async provide (): Promise<Shell[]> {
@@ -59,6 +93,7 @@ export class WSLShellProvider extends ShellProvider {
if (lxss?.DefaultDistribution) {
const defaultDistKey = wnr.getRegistryKey(wnr.HK.CU, lxssPath + '\\' + String(lxss.DefaultDistribution.value))
if (defaultDistKey?.DistributionName) {
const _icon = await this._resolveIcon(defaultDistKey)
const shell: Shell = {
id: 'wsl',
name: 'WSL / Default distro',
@@ -68,7 +103,7 @@ export class WSLShellProvider extends ShellProvider {
COLORTERM: 'truecolor',
},
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
icon: wslIconMap[defaultDistKey.DistributionName.value] ?? wslIconMap.Linux,
icon: wslIconMap[defaultDistKey.DistributionName.value] ?? _icon,
}
shells.push(shell)
}
@@ -90,11 +125,14 @@ export class WSLShellProvider extends ShellProvider {
return []
}
}
for (const child of wnr.listRegistrySubkeys(wnr.HK.CU, lxssPath) as string[]) {
const childKey = wnr.getRegistryKey(wnr.HK.CU, lxssPath + '\\' + child)
if (!childKey.DistributionName || !childKey.BasePath) {
continue
}
const _icon = await this._resolveIcon(childKey)
const wslVersion = (childKey.Flags?.value || 0) & 8 ? 2 : 1
const name = childKey.DistributionName.value
const fsBase = wslVersion === 2 ? `\\\\wsl$\\${name}` : childKey.BasePath.value as string + '\\rootfs'
@@ -110,7 +148,7 @@ export class WSLShellProvider extends ShellProvider {
COLORTERM: 'truecolor',
},
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
icon: wslIconMap[name] ?? wslIconMap.Linux,
icon: wslIconMap[name] ?? _icon,
}
shells.push(shell)
}

View File

@@ -1,7 +1,10 @@
terminal-toolbar([tab]='this')
i.fas.fa-xs.fa-circle.text-success.me-2(*ngIf='session && session.open')
i.fas.fa-xs.fa-circle.text-danger.me-2(*ngIf='!session || !session.open')
strong.me-auto {{profile.options.user}}@{{profile.options.host}}:{{profile.options.port}}
strong.me-auto(
style='user-select: text; cursor: text;'
onclick='event.stopPropagation()'
) {{profile.options.user}}@{{profile.options.host}}:{{profile.options.port}}
.me-2(
ngbDropdown,

View File

@@ -1,4 +1,12 @@
import 'ssh2'
const nodeCrypto = require('crypto')
const browserDH = require('diffie-hellman/browser')
nodeCrypto.createDiffieHellmanGroup = browserDH.createDiffieHellmanGroup
nodeCrypto.createDiffieHellman = browserDH.createDiffieHellman
// Declare function missing from @types
declare module 'ssh2' {
interface Client {
setNoDelay: (enable?: boolean) => this
}
}

View File

@@ -218,6 +218,8 @@ export class SSHSession {
const resultPromise: Promise<void> = new Promise(async (resolve, reject) => {
ssh.on('ready', () => {
connected = true
// Fix SSH Lagging
ssh.setNoDelay(true)
if (this.savedPassword) {
this.passwordStorage.savePassword(this.profile, this.savedPassword)
}