Skip to content

Commit 359d829

Browse files
authored
Merge pull request #2 from fosslife/master
fix: cleanup
2 parents 6174d0e + 60ec430 commit 359d829

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

srcjs/terminal/ProfileManager.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { Config, Profile, Profiles } from "../config";
2+
13
export class ProfileManager {
24
private modal: HTMLElement | null = null;
35

46
constructor(
57
private config: Config,
6-
private onSave: (profiles: ProfilesConfig) => void
8+
private onSave: (profiles: Profiles) => void
79
) {}
810

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

32-
this.config.profiles?.list.forEach((profile, index) => {
33-
const profileItem = this.createProfileItem(profile, index);
34+
this.config.profiles?.list.forEach((profile: Profile) => {
35+
const profileItem = this.createProfileItem(profile);
3436
profileList.appendChild(profileItem);
3537
});
3638

@@ -40,7 +42,7 @@ export class ProfileManager {
4042
addButton.textContent = "+ Add Profile";
4143
addButton.addEventListener("click", () => {
4244
const newProfile = this.createNewProfile();
43-
const profileItem = this.createProfileItem(newProfile, -1);
45+
const profileItem = this.createProfileItem(newProfile);
4446
profileList.appendChild(profileItem);
4547
});
4648

@@ -74,7 +76,7 @@ export class ProfileManager {
7476
}, 10);
7577
}
7678

77-
private createProfileItem(profile: Profile, index: number): HTMLElement {
79+
private createProfileItem(profile: Profile): HTMLElement {
7880
const item = document.createElement("div");
7981
item.className = "profile-item";
8082

srcjs/terminal/TerminalInstance.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ export class TerminalInstance {
1919
private container: HTMLElement | null = null;
2020
private resizeObserver: ResizeObserver | null = null;
2121
private unlistenOutput: (() => void) | null = null;
22-
private lastScrollPosition = 0;
23-
private visible = false;
2422
private focused: boolean = false;
2523

2624
constructor(
@@ -188,7 +186,6 @@ export class TerminalInstance {
188186
this.focus();
189187

190188
// Track visibility changes
191-
this.visible = true;
192189
this.fit(); // Initial fit
193190

194191
this.setupFocusTracking();
@@ -204,7 +201,6 @@ export class TerminalInstance {
204201
focus(): void {
205202
if (this.xterm) {
206203
this.focused = true;
207-
this.lastScrollPosition = this.xterm.buffer.active.viewportY;
208204
this.xterm.focus();
209205
}
210206
}

0 commit comments

Comments
 (0)