terminal prompt needs to be recyclable
This commit is contained in:
10
src/components/react/shell/prompt.tsx
Normal file
10
src/components/react/shell/prompt.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import { working_dir } from "../fs"
|
||||
import rgb, { cyan, green } from "./color"
|
||||
|
||||
const GetWorkingDir = () => working_dir === "user" ? "~" : working_dir
|
||||
|
||||
export default function Prompt() {
|
||||
const user = cyan("user")
|
||||
const dir = green(GetWorkingDir())
|
||||
return <p>{user}@host {dir}{"> "}</p>
|
||||
}
|
Reference in New Issue
Block a user