mirror of
https://github.com/openai/codex.git
synced 2026-05-01 18:06:47 +00:00
fix: add support for fileOpener in config.json (#911)
This PR introduces the following type: ```typescript export type FileOpenerScheme = "vscode" | "cursor" | "windsurf"; ``` and uses it as the new type for a `fileOpener` option in `config.json`. If set, this will be used to linkify file annotations in the output using the URI-based file opener supported in VS Code-based IDEs. Currently, this does not pass: Updated `codex-cli/tests/markdown.test.tsx` to verify the new behavior. Note it required mocking `supports-hyperlinks` and temporarily modifying `chalk.level` to yield the desired output.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { TerminalChatSession } from "../../utils/session.js";
|
||||
import type { ResponseItem } from "openai/resources/responses/responses";
|
||||
import type { FileOpenerScheme } from "src/utils/config.js";
|
||||
|
||||
import TerminalChatResponseItem from "./terminal-chat-response-item";
|
||||
import { Box, Text } from "ink";
|
||||
@@ -8,9 +9,11 @@ import React from "react";
|
||||
export default function TerminalChatPastRollout({
|
||||
session,
|
||||
items,
|
||||
fileOpener,
|
||||
}: {
|
||||
session: TerminalChatSession;
|
||||
items: Array<ResponseItem>;
|
||||
fileOpener: FileOpenerScheme | undefined;
|
||||
}): React.ReactElement {
|
||||
const { version, id: sessionId, model } = session;
|
||||
return (
|
||||
@@ -51,9 +54,13 @@ export default function TerminalChatPastRollout({
|
||||
{React.useMemo(
|
||||
() =>
|
||||
items.map((item, key) => (
|
||||
<TerminalChatResponseItem key={key} item={item} />
|
||||
<TerminalChatResponseItem
|
||||
key={key}
|
||||
item={item}
|
||||
fileOpener={fileOpener}
|
||||
/>
|
||||
)),
|
||||
[items],
|
||||
[items, fileOpener],
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user