Skip to content

Commit

Permalink
fix: properly lock terminal, fixes essserrr#17
Browse files Browse the repository at this point in the history
  • Loading branch information
yanickrochon committed Nov 18, 2024
1 parent bb45412 commit 8112be4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import InputString from './components/InputString/InputString';
import classes from './command-line.module.scss';

interface CommandLineProps {
disabled: boolean;
prompt: string;
cursorSymbol: string;
state: CommandLineState;
Expand All @@ -16,6 +17,7 @@ interface CommandLineProps {
const CommandLine = React.forwardRef<HTMLInputElement, CommandLineProps>(
(
{
disabled,
state: { cursorPosition, renderValue, inputValue },
handleKeyboardDown,
handleInputChange,
Expand Down Expand Up @@ -49,10 +51,11 @@ const CommandLine = React.forwardRef<HTMLInputElement, CommandLineProps>(
onInput={handleInput}
onKeyDown={handleKeyDown}
type="text"
disabled={disabled}
/>
<div className={[classes.inputString, 'crt-command-line__input-string'].join(' ')}>
<InputString renderValue={renderValue} cursorPosition={cursorPosition} />
{lastSelected && (
{lastSelected && !disabled && (
<Character className="crt-cursor-symbol" selected>
{cursorSymbol}
</Character>
Expand Down
1 change: 1 addition & 0 deletions packages/crt-terminal/src/components/Terminal/Terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ const Terminal = function Terminal({
prompt={prompt}
cursorSymbol={cursorSymbol}
state={commandLine.state}
disabled={terminalApp.state.inputLocked}
handleKeyboardDown={handleKeyboardDown}
handleInputChange={handleInputChange}
/>
Expand Down

0 comments on commit 8112be4

Please sign in to comment.