diff --git a/plugins/plugin-codeflare/src/components/RestartableTerminal.tsx b/plugins/plugin-codeflare/src/components/RestartableTerminal.tsx index e66f49ec..388fceff 100644 --- a/plugins/plugin-codeflare/src/components/RestartableTerminal.tsx +++ b/plugins/plugin-codeflare/src/components/RestartableTerminal.tsx @@ -19,7 +19,7 @@ import { PassThrough } from "stream" import { Loading } from "@kui-shell/plugin-client-common" import { Arguments, Job, isResizable } from "@kui-shell/core" -import Terminal from "./Terminal" +import Terminal, { TerminalOptions } from "./Terminal" /** * This is our impl of the `watch` property that our Terminal @@ -34,16 +34,17 @@ function watch(stream: PassThrough, job: Job) { } } -export type Props = Pick & { - /** Execute this command line */ - cmdline: string +export type Props = Pick & + TerminalOptions & { + /** Execute this command line */ + cmdline: string - /** Execute the given `cmdline` with this set of environment variables */ - env: Record + /** Execute the given `cmdline` with this set of environment variables */ + env: Record - /** Callback when the underlying PTY exits */ - onExit?(code: number): void -} + /** Callback when the underlying PTY exits */ + onExit?(code: number): void + } type State = { startCount?: number @@ -134,7 +135,7 @@ export default class RestartableTerminal extends React.PureComponent - + ) } diff --git a/plugins/plugin-codeflare/src/components/Terminal.tsx b/plugins/plugin-codeflare/src/components/Terminal.tsx index bd2f5634..49712c5f 100644 --- a/plugins/plugin-codeflare/src/components/Terminal.tsx +++ b/plugins/plugin-codeflare/src/components/Terminal.tsx @@ -49,7 +49,12 @@ type ClassName = { className?: string } -interface Props extends ClassName { +export type TerminalOptions = ClassName & { + /** Show search ui? [default: true] */ + searchable?: boolean +} + +type Props = TerminalOptions & { /** If given, the initial terminal output to render */ initialContent?: string @@ -257,7 +262,7 @@ export default class XTerm extends React.PureComponent { const standIn = document.querySelector("body .repl") if (standIn) { const fontTheme = getComputedStyle(standIn) - xterm.options.fontSize = (parseInt(fontTheme.fontSize.replace(/px$/, ""), 10) * 16) / 14 + xterm.options.fontSize = parseInt(fontTheme.fontSize.replace(/px$/, ""), 10) // terminal.setOption('lineHeight', )//parseInt(fontTheme.lineHeight.replace(/px$/, ''), 10)) // FIXME. not tied to theme @@ -342,7 +347,7 @@ export default class XTerm extends React.PureComponent { - {this.searchInput()} + {this.props.searchable !== false && this.searchInput()} diff --git a/plugins/plugin-codeflare/src/controller/terminal.tsx b/plugins/plugin-codeflare/src/controller/terminal.tsx index 4ac3a059..957dc91e 100644 --- a/plugins/plugin-codeflare/src/controller/terminal.tsx +++ b/plugins/plugin-codeflare/src/controller/terminal.tsx @@ -54,7 +54,7 @@ export async function shell(args: Arguments) { } } -export type Props = Pick & { +export type Props = Pick & { /** Default guidebook (if not given, we will take the value from the client definition) */ defaultGuidebook?: string @@ -96,7 +96,7 @@ export class TaskTerminal extends React.PureComponent { private readonly splits = { horizontal: [35, 65], vertical1: [100], // no `this.props.belowTerminal` - vertical2: [50, 50], // yes + vertical2: [40, 60], // yes } private readonly tasks = [{ label: "Run a Job", argv: ["codeflare", "-p", "${SELECTED_PROFILE}"] }]