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 scripts/code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function code() {
exec "$CODE" . $DISABLE_TEST_EXTENSION "$@"
}

function code-wsl()
function code_wsl()
{
HOST_IP=$(echo "" | powershell.exe -noprofile -Command "& {(Get-NetIPAddress | Where-Object {\$_.InterfaceAlias -like '*WSL*' -and \$_.AddressFamily -eq 'IPv4'}).IPAddress | Write-Host -NoNewline}")
export DISPLAY="$HOST_IP:0"
Expand All @@ -77,7 +77,7 @@ function code-wsl()
}

if [ "$IN_WSL" == "true" ] && [ -z "$DISPLAY" ]; then
code-wsl "$@"
code_wsl "$@"
elif [ -f /mnt/wslg/versions.txt ]; then
code --disable-gpu "$@"
elif [ -f /.dockerenv ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,10 @@ export const VoidInputBox2 = forwardRef<HTMLTextAreaElement, InputBox2Props>(fun
if (e.key === 'Enter') {
// Shift + Enter when multiline = newline
const shouldAddNewline = e.shiftKey && multiline
if (!shouldAddNewline) e.preventDefault(); // prevent newline from being created
// 只有在非输入法组合状态下才阻止默认行为
if (!shouldAddNewline && !e.nativeEvent.isComposing) {
e.preventDefault(); // prevent newline from being created
}
}
onKeyDown?.(e)
}, [onKeyDown, onMenuKeyDown, multiline])}
Expand Down