Skip to content

Commit 3061105

Browse files
BrunoQuaresmakylecarbs
authored andcommitted
feat: Open terminal in a new window (#2017)
1 parent 4b426c5 commit 3061105

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

site/src/components/TerminalLink/TerminalLink.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { combineClasses } from "../../util/combineClasses"
77

88
export const Language = {
99
linkText: "Open terminal",
10+
terminalTitle: "Terminal",
1011
}
1112

1213
export interface TerminalLinkProps {
@@ -25,12 +26,17 @@ export interface TerminalLinkProps {
2526
*/
2627
export const TerminalLink: FC<TerminalLinkProps> = ({ agentName, userName = "me", workspaceName, className }) => {
2728
const styles = useStyles()
29+
const href = `/${userName}/${workspaceName}${agentName ? `.${agentName}` : ""}/terminal`
2830

2931
return (
3032
<Link
31-
href={`/${userName}/${workspaceName}${agentName ? `.${agentName}` : ""}/terminal`}
33+
href={href}
3234
className={combineClasses([styles.link, className])}
3335
target="_blank"
36+
onClick={(event) => {
37+
event.preventDefault()
38+
window.open(href, Language.terminalTitle, "width=900,height=600")
39+
}}
3440
>
3541
<ComputerIcon className={styles.icon} />
3642
{Language.linkText}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy