Skip to content
Closed
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
2 changes: 1 addition & 1 deletion apps/desktop/src/renderer/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
margin: 0;
overflow: hidden; /* prevent scroll-lock adjustments from collapsing layout */
user-select: none;
scroll-behavior: smooth;
scroll-behavior: auto;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about this

-webkit-app-region: no-drag;
-webkit-font-smoothing: antialiased;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Terminal } from "@xterm/xterm";
import { useCallback, useEffect, useState } from "react";
import { HiArrowDown } from "react-icons/hi2";
import { useHotkeyText } from "renderer/stores/hotkeys";
import { smoothScrollToBottom } from "../utils";
import { scrollToBottom } from "../utils";

interface ScrollToBottomButtonProps {
terminal: Terminal | null;
Expand Down Expand Up @@ -42,7 +42,7 @@ export function ScrollToBottomButton({ terminal }: ScrollToBottomButtonProps) {

const handleClick = () => {
if (terminal) {
smoothScrollToBottom(terminal);
scrollToBottom(terminal);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ import { TerminalSearch } from "./TerminalSearch";
import type { TerminalProps, TerminalStreamEvent } from "./types";
import {
getScrollOffsetFromBottom,
scrollToBottom,
shellEscapePaths,
smoothScrollToBottom,
} from "./utils";

const FIRST_RENDER_RESTORE_FALLBACK_MS = 250;
Expand Down Expand Up @@ -934,7 +934,7 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => {
"SCROLL_TO_BOTTOM",
() => {
if (xtermRef.current) {
smoothScrollToBottom(xtermRef.current);
scrollToBottom(xtermRef.current);
}
},
{ enabled: isFocused, preventDefault: true },
Expand Down Expand Up @@ -1266,7 +1266,7 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => {
};

const handleScrollToBottom = () => {
smoothScrollToBottom(xterm);
scrollToBottom(xterm);
};

const handleWrite = (data: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export function shellEscapePaths(paths: string[]): string {
return quote(paths);
}

export function smoothScrollToBottom(terminal: Terminal): void {
export function scrollToBottom(terminal: Terminal): void {
const viewport = terminal.element?.querySelector(".xterm-viewport");
if (viewport) {
viewport.scrollTo({
top: viewport.scrollHeight,
behavior: "smooth",
behavior: "instant",
});
} else {
terminal.scrollToBottom();
Expand Down