Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/api/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ const initTerminal = ({
inputContainer,
input,

print: (content: string, isCommand = false, scrollIntoView = true) =>
print(content, isCommand, scrollIntoView, commandContainer, input, settings),
print: (content: string, isCommand = false, scrollIntoView = true, cstyle?: string) =>
print(content, cstyle, isCommand, scrollIntoView, commandContainer, input, settings),
run: (cmd: string) => evalCommand(cmd, terminal),
start: () => startProcess(terminal),
stop: () => stopProcess(terminal),
Expand Down
3 changes: 2 additions & 1 deletion src/api/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import { TerminalSettings } from '../types'
// Prints a new line in the terminal
const print = (
content: string,
cstyle: string | undefined,
isCommand: boolean,
scrollIntoView: boolean,
commandContainer: HTMLElement,
input: HTMLElement,
settings: TerminalSettings
) => {
const line = create('p', undefined, isCommand ? settings.prompt : content)
const line = create('p', cstyle , isCommand ? settings.prompt : content)
if (isCommand) {
const cmd = create('span', 'terminal-command', content)
line.append(cmd)
Expand Down
2 changes: 1 addition & 1 deletion src/types/terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type TerminalInstance = {
input: HTMLInputElement
history: string[]
lastHistoryIndex: number
print: (text: string, isCommand?: boolean, scrollIntoView?: boolean) => void
print: (text: string, isCommand?: boolean, scrollIntoView?: boolean, cstyle?: string) => void
run: (cmd: string) => void
start: () => void
stop: () => void
Expand Down
Loading