+
+
+ Terminal (read-only)
+
+
+
+ );
+}
+
+export default Terminal;
diff --git a/frontend/src/hooks/useTerminal.ts b/frontend/src/hooks/useTerminal.ts
new file mode 100644
index 0000000000..cf198c3487
--- /dev/null
+++ b/frontend/src/hooks/useTerminal.ts
@@ -0,0 +1,72 @@
+import { FitAddon } from "@xterm/addon-fit";
+import { Terminal } from "@xterm/xterm";
+import React from "react";
+import { Command } from "#/state/commandSlice";
+
+/*
+ NOTE: Tests for this hook are indirectly covered by the tests for the XTermTerminal component.
+ The reason for this is that the hook exposes a ref that requires a DOM element to be rendered.
+*/
+
+export const useTerminal = (commands: Command[] = []) => {
+ const terminal = React.useRef