Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f72a6d0

Browse files
authored
fix: Open new windows for terminals (coder#2568)
1 parent c366725 commit f72a6d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

site/src/components/TerminalLink/TerminalLink.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import ComputerIcon from "@material-ui/icons/Computer"
44
import { FC } from "react"
55
import * as TypesGen from "../../api/typesGenerated"
66
import { combineClasses } from "../../util/combineClasses"
7+
import { generateRandomString } from "../../util/random"
78

89
export const Language = {
910
linkText: "Open terminal",
10-
terminalTitle: "Terminal",
11+
terminalTitle: (identifier: string): string => `Terminal - ${identifier}`,
1112
}
1213

1314
export interface TerminalLinkProps {
@@ -35,7 +36,7 @@ export const TerminalLink: FC<TerminalLinkProps> = ({ agentName, userName = "me"
3536
target="_blank"
3637
onClick={(event) => {
3738
event.preventDefault()
38-
window.open(href, Language.terminalTitle, "width=900,height=600")
39+
window.open(href, Language.terminalTitle(generateRandomString(12)), "width=900,height=600")
3940
}}
4041
>
4142
<ComputerIcon className={styles.icon} />

0 commit comments

Comments
 (0)