@@ -2,6 +2,7 @@ import { app, BrowserWindow, ipcMain, dialog } from "electron";
22import * as pty from "node-pty" ;
33import * as os from "os" ;
44import { simpleGit } from "simple-git" ;
5+ import Store from "electron-store" ;
56
67interface SessionConfig {
78 projectDir : string ;
@@ -11,6 +12,7 @@ interface SessionConfig {
1112
1213let mainWindow : BrowserWindow ;
1314const sessions = new Map < string , pty . IPty > ( ) ;
15+ const store = new Store ( ) ;
1416
1517// Open directory picker
1618ipcMain . handle ( "select-directory" , async ( ) => {
@@ -37,6 +39,20 @@ ipcMain.handle("get-branches", async (_event, dirPath: string) => {
3739 }
3840} ) ;
3941
42+ // Get last used settings
43+ ipcMain . handle ( "get-last-settings" , ( ) => {
44+ return ( store as any ) . get ( "lastSessionConfig" , {
45+ projectDir : "" ,
46+ parentBranch : "" ,
47+ codingAgent : "claude" ,
48+ } ) ;
49+ } ) ;
50+
51+ // Save settings
52+ ipcMain . on ( "save-settings" , ( _event , config : SessionConfig ) => {
53+ ( store as any ) . set ( "lastSessionConfig" , config ) ;
54+ } ) ;
55+
4056// Create new session
4157ipcMain . on ( "create-session" , ( event , config : SessionConfig ) => {
4258 const sessionId = `session-${ Date . now ( ) } ` ;
0 commit comments