minor fixes
This commit is contained in:
parent
726584146d
commit
d2f1e43d1d
|
@ -86,6 +86,7 @@ import { KeypressProvider } from './contexts/KeypressContext.js';
|
|||
import { useKittyKeyboardProtocol } from './hooks/useKittyKeyboardProtocol.js';
|
||||
import { keyMatchers, Command } from './keyMatchers.js';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import { UpdateNotification } from './components/UpdateNotification.js';
|
||||
import {
|
||||
isProQuotaExceededError,
|
||||
|
@ -643,6 +644,13 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
|||
previousStreamingState.current = streamingState;
|
||||
}, [streamingState, sessionStats.sessionId]);
|
||||
|
||||
useEffect(() => {
|
||||
process.on('exit', () => {
|
||||
const statsPath = path.join('/tmp', `regex.${sessionStats.sessionId}.stats`);
|
||||
fs.writeFileSync(statsPath, JSON.stringify(sessionStats, null, 2));
|
||||
});
|
||||
}, [sessionStats]);
|
||||
|
||||
const handleIdePromptComplete = useCallback(
|
||||
(result: IdeIntegrationNudgeResult) => {
|
||||
if (result.userSelection === 'yes') {
|
||||
|
|
|
@ -30,7 +30,7 @@ import {
|
|||
import { ContentGenerator } from './contentGenerator.js';
|
||||
import { toContents } from '../code_assist/converter.js';
|
||||
import { isStructuredError } from '../utils/quotaErrorDetection.js';
|
||||
import { ExecException } from 'child_process';
|
||||
import { ExecException, exec } from 'child_process';
|
||||
|
||||
interface StructuredError {
|
||||
status: number;
|
||||
|
@ -119,7 +119,6 @@ export class LoggingContentGenerator implements ContentGenerator {
|
|||
const jsonPayload = JSON.stringify(req, null, 2);
|
||||
fs.writeFileSync(filePath, jsonPayload);
|
||||
this.requestCounter++;
|
||||
const { exec } = require('child_process');
|
||||
exec(`regex --json ${filePath}`, (error: ExecException | null, stdout: string, stderr: string) => {
|
||||
if (error) {
|
||||
console.error(`exec error: ${error}`);
|
||||
|
@ -157,7 +156,6 @@ export class LoggingContentGenerator implements ContentGenerator {
|
|||
const jsonPayload = JSON.stringify(req, null, 2);
|
||||
fs.writeFileSync(filePath, jsonPayload);
|
||||
this.requestCounter++;
|
||||
const { exec } = require('child_process');
|
||||
exec(`regex --json ${filePath}`, (error: ExecException | null, stdout: string, stderr: string) => {
|
||||
if (error) {
|
||||
console.error(`exec error: ${error}`);
|
||||
|
|
Loading…
Reference in New Issue