Terminal exit goes back

This commit is contained in:
Daniel Kluge 2022-10-29 22:19:57 +02:00
parent e97c00ed89
commit 2a03646196
2 changed files with 5 additions and 6 deletions

View File

@ -225,12 +225,9 @@ const exitCmd: Command = {
window.opener = null; window.opener = null;
window.open("", "_self"); window.open("", "_self");
window.close(); window.close();
window.history.back();
} }
return [ return [];
"If you can read this, closing the window did not work.",
"This is most likely because of a restriction in JavaScript.",
"#{Read more here|https://developer.mozilla.org/en-US/docs/Web/API/Window/close}."
];
} }
}; };

View File

@ -1,8 +1,8 @@
import type { NextPage, GetStaticProps } from "next"; import type { NextPage, GetStaticProps } from "next";
import Head from "next/head"; import Head from "next/head";
import Link from "next/link";
import Icon from "@mdi/react"; import Icon from "@mdi/react";
import { mdiEmail } from "@mdi/js"; import { mdiEmail } from "@mdi/js";
import { Discord, Github, Instagram, Steam, Linkedin } from "@icons-pack/react-simple-icons";
import { useEffect, useRef,useCallback } from "react"; import { useEffect, useRef,useCallback } from "react";
import { useCommands } from "../lib/commands/ContextProvider"; import { useCommands } from "../lib/commands/ContextProvider";
import { useModalFunctions } from "../components/Terminal/contexts/ModalFunctions"; import { useModalFunctions } from "../components/Terminal/contexts/ModalFunctions";
@ -64,6 +64,8 @@ const Terminal: NextPage<{ buildTime: string }> = ({ buildTime }) => {
<div className={styles.container}> <div className={styles.container}>
<div className={styles.header}> <div className={styles.header}>
<span className={styles.spacer} onClick={focusInput}>&nbsp;</span> <span className={styles.spacer} onClick={focusInput}>&nbsp;</span>
<Link href="/"><a>Main page</a></Link>
<span className={styles.divider}>|</span>
<a href="https://github.com/C0ntroller/c0ntroller.de" target="_blank" rel="noreferrer">Source</a> <a href="https://github.com/C0ntroller/c0ntroller.de" target="_blank" rel="noreferrer">Source</a>
<span className={styles.divider}>|</span> <span className={styles.divider}>|</span>
<a href="https://github.com/C0ntroller/c0ntroller.de/issues/new" target="_blank" rel="noreferrer">Bug?</a> <a href="https://github.com/C0ntroller/c0ntroller.de/issues/new" target="_blank" rel="noreferrer">Bug?</a>