Fixed terminal
All checks were successful
Docker Deploy / build-and-push (push) Successful in 3m34s

This commit is contained in:
2025-06-09 12:44:53 -06:00
parent 4985310ec2
commit 6b6b571dd6
3 changed files with 314 additions and 299 deletions

View File

@ -28,6 +28,7 @@ interface Command {
input: string;
output: string;
timestamp: Date;
path: string;
}
const Terminal = () => {
@ -36,7 +37,8 @@ const Terminal = () => {
{
input: '',
output: 'Welcome to Atridad\'s Shell!\nType "help" to see available commands.\n',
timestamp: new Date()
timestamp: new Date(),
path: '/'
}
]);
const [currentInput, setCurrentInput] = useState('');
@ -202,7 +204,7 @@ ${post.content}`;
'about.txt': {
type: 'file',
name: 'about.txt',
content: `${resumeData.basics.name}\nResearcher, Full-Stack Developer, and IT Professional.\n\nA passionate technologist who loves building things and solving problems.\n\nVisit other sections to learn more about my work and experience.`
content: `${resumeData.basics.name}\nResearcher, Full-Stack Developer, and IT Professional.\n\nVisit other sections to learn more about my work and experience.`
},
'resume': {
type: 'directory',
@ -551,7 +553,8 @@ ${post.content}`;
const newCommand: Command = {
input: currentInput,
output,
timestamp: new Date()
timestamp: new Date(),
path: currentPath
};
// Save command to persistent history
@ -620,7 +623,7 @@ ${post.content}`;
<div
ref={terminalRef}
className="flex-1 p-4 overflow-hidden scrollbar-thin scrollbar-thumb-base-300 scrollbar-track-base-100 relative"
className="flex-1 p-4 overflow-y-auto scrollbar-thin scrollbar-thumb-base-300 scrollbar-track-base-100 relative"
onClick={() => inputRef.current?.focus()}
>
{isTrainRunning && (
@ -645,28 +648,28 @@ __/ =| o |=-O=====O=====O=====O \\ ____Y___________|__|_________________________
</div>
)}
{!isTrainRunning && (
<div className="overflow-y-auto h-full">
{commandHistory.map((command: Command, index: number) => (
<div key={index} className="mb-2">
{command.input && (
<div className="flex items-center">
<span className="text-primary font-semibold">guest@atri.dad</span>
<span className="text-base-content">:</span>
<span className="text-secondary font-semibold">{currentPath}</span>
<span className="text-base-content">$ </span>
<span className="text-accent">{command.input}</span>
</div>
)}
{command.output && (
<div
className="whitespace-pre-wrap text-base-content/80 mt-1"
dangerouslySetInnerHTML={{ __html: formatOutput(command.output) }}
/>
)}
</div>
))}
<div className="min-h-full">
{commandHistory.map((command: Command, index: number) => (
<div key={index} className="mb-2">
{command.input && (
<div className="flex items-center">
<span className="text-primary font-semibold">guest@atri.dad</span>
<span className="text-base-content">:</span>
<span className="text-secondary font-semibold">{command.path}</span>
<span className="text-base-content">$ </span>
<span className="text-accent">{command.input}</span>
</div>
)}
{command.output && (
<div
className="whitespace-pre-wrap text-base-content/80 mt-1"
dangerouslySetInnerHTML={{ __html: formatOutput(command.output) }}
/>
)}
</div>
))}
{!isTrainRunning && (
<form onSubmit={handleSubmit} className="flex items-center">
<span className="text-primary font-semibold">guest@atri.dad</span>
<span className="text-base-content">:</span>
@ -683,8 +686,8 @@ __/ =| o |=-O=====O=====O=====O \\ ____Y___________|__|_________________________
spellcheck={false}
/>
</form>
</div>
)}
)}
</div>
</div>
</div>
);