Skip to content

Commit

Permalink
fix tab icon loading
Browse files Browse the repository at this point in the history
  • Loading branch information
avocadianmage committed Sep 8, 2018
1 parent ad10f7c commit 5313185
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boysen",
"version": "1.0.1",
"version": "1.0.2",
"description": "A modern and lightweight PowerShell emulator",
"main": "src/ts-build/main.js",
"scripts": {
Expand All @@ -23,7 +23,7 @@
"ajv": "^6.0.0",
"dragula": "^3.7.2",
"electron-tabs": "^0.9.4",
"file-icon-info": "^1.0.14",
"file-icon-info": "^1.0.15",
"node-pty": "^0.7.6",
"xterm": "^3.6.0"
},
Expand Down
13 changes: 8 additions & 5 deletions src/ts/TabManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,17 @@ export class TabManager {
}

private setTabIconFromShell(tab: TabGroup.Tab, exeName: string) {
const appDataPath = process.env.APPDATA;
const appName = path.basename(process.argv[1]);
const iconPath
= `${appDataPath}/${appName}/Cache/shell-icons/${exeName}.ico`;
const iconPath = path.join(
process.env.APPDATA!,
'boysen',
'Cache',
'shell-icons',
`${exeName}.ico`
);

// If icon file is already cached, use it.
if (fs.existsSync(iconPath)) tab.setIcon(iconPath);

// Find the full file path of the shell executable and extract its icon.
else exec('where ' + exeName, (err, stdout, stderr) => {
if (err) console.log(stderr);
Expand Down

0 comments on commit 5313185

Please # to comment.