Skip to content

Commit

Permalink
Merge pull request #2 from fosslife/master
Browse files Browse the repository at this point in the history
fix: cleanup
  • Loading branch information
Sparkenstein authored Feb 14, 2025
2 parents 6174d0e + 60ec430 commit 359d829
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 7 additions & 5 deletions srcjs/terminal/ProfileManager.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Config, Profile, Profiles } from "../config";

export class ProfileManager {
private modal: HTMLElement | null = null;

constructor(
private config: Config,
private onSave: (profiles: ProfilesConfig) => void
private onSave: (profiles: Profiles) => void
) {}

show(): void {
Expand All @@ -29,8 +31,8 @@ export class ProfileManager {
const profileList = document.createElement("div");
profileList.className = "profile-list";

this.config.profiles?.list.forEach((profile, index) => {
const profileItem = this.createProfileItem(profile, index);
this.config.profiles?.list.forEach((profile: Profile) => {
const profileItem = this.createProfileItem(profile);
profileList.appendChild(profileItem);
});

Expand All @@ -40,7 +42,7 @@ export class ProfileManager {
addButton.textContent = "+ Add Profile";
addButton.addEventListener("click", () => {
const newProfile = this.createNewProfile();
const profileItem = this.createProfileItem(newProfile, -1);
const profileItem = this.createProfileItem(newProfile);
profileList.appendChild(profileItem);
});

Expand Down Expand Up @@ -74,7 +76,7 @@ export class ProfileManager {
}, 10);
}

private createProfileItem(profile: Profile, index: number): HTMLElement {
private createProfileItem(profile: Profile): HTMLElement {
const item = document.createElement("div");
item.className = "profile-item";

Expand Down
4 changes: 0 additions & 4 deletions srcjs/terminal/TerminalInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export class TerminalInstance {
private container: HTMLElement | null = null;
private resizeObserver: ResizeObserver | null = null;
private unlistenOutput: (() => void) | null = null;
private lastScrollPosition = 0;
private visible = false;
private focused: boolean = false;

constructor(
Expand Down Expand Up @@ -188,7 +186,6 @@ export class TerminalInstance {
this.focus();

// Track visibility changes
this.visible = true;
this.fit(); // Initial fit

this.setupFocusTracking();
Expand All @@ -204,7 +201,6 @@ export class TerminalInstance {
focus(): void {
if (this.xterm) {
this.focused = true;
this.lastScrollPosition = this.xterm.buffer.active.viewportY;
this.xterm.focus();
}
}
Expand Down

0 comments on commit 359d829

Please sign in to comment.