diff --git a/README.md b/README.md index 7214638..897655b 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,12 @@ Here are the cases that Decky Terminal can help you out! * [Play BadApple](https://www.youtube.com/watch?v=pSygAG933Yw) ## TODO -* Gamepad support (up/down/left/right for arrow keys, etc.) * **PROPERLY** implement on-screen keyboard support (currently implemented via workaround) +* ~~Gamepad support (up/down/left/right for arrow keys, etc.)~~ **Need to remove some bug** * ~~multi-instance support (implemented on backend, but not on frontend. yet.)~~ +Want some features to be implemented? Please make an issue on issues page! + ## Build Instructions ### Prerequisites * Linux Installation (for prebuilt Decky Loader CLI) or Rust **NIGHTLY** installation on POSIX Compliant OS (e.g. macOS) diff --git a/defaults/py_modules/decky_terminal/__init__.py b/defaults/py_modules/decky_terminal/__init__.py index f5f1e26..c4c3a69 100644 --- a/defaults/py_modules/decky_terminal/__init__.py +++ b/defaults/py_modules/decky_terminal/__init__.py @@ -103,7 +103,7 @@ async def _get_config(self) -> Optional[dict]: return None async def _write_config(self, config: dict) -> bool: - return await Common.write_file(self.get_config_filename(), json.dumps(config)) + return await Common.write_file(self.get_config_filename (), json.dumps(config)) # TERMINAL CREATION ===================================== async def create_terminal(self, id: str, cmdline: Optional[str] = None): diff --git a/defaults/py_modules/decky_terminal/terminal.py b/defaults/py_modules/decky_terminal/terminal.py index d0be83d..7ef3962 100644 --- a/defaults/py_modules/decky_terminal/terminal.py +++ b/defaults/py_modules/decky_terminal/terminal.py @@ -165,12 +165,12 @@ def is_subscriber(self, ws: WebSocketServerProtocol): return False # WEBSOCKET - INTERNAL ================================== - def _remove_subscriber(self, ws: WebSocketServerProtocol): + async def _remove_subscriber(self, ws: WebSocketServerProtocol): # Internal only! if self.is_subscriber(ws): self.subscribers.remove(ws) if not ws.closed: - ws.close() + await ws.close() # BROADCAST ============================================= async def broadcast_subscribers(self, data: bytes): @@ -182,12 +182,11 @@ async def broadcast_subscribers(self, data: bytes): await ws.send(data) for ws in closed: - self._remove_subscriber(ws) + await self._remove_subscriber(ws) async def close_subscribers(self): for ws in self.subscribers: - if not ws.closed: - ws.close() + await self._remove_subscriber(ws) # IS ALIVE ============================================== def _is_process_started(self): diff --git a/package.json b/package.json index 6c8a996..6f2a3cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "decky-terminal", - "version": "0.2.1", + "version": "0.2.2", "description": "A long-awaited terminal plugin that turns your steamdeck into Linux battlestation.", "scripts": { "build": "shx rm -rf dist && rollup -c", diff --git a/src/pages/Terminal.tsx b/src/pages/Terminal.tsx index c315b78..57dfce2 100644 --- a/src/pages/Terminal.tsx +++ b/src/pages/Terminal.tsx @@ -14,7 +14,7 @@ import { AttachAddon } from "xterm-addon-attach"; import { FitAddon } from 'xterm-addon-fit'; import TerminalGlobal from "../common/global"; import XTermCSS from "../common/xterm_css"; -import { FaExpand, FaGamepad, FaKeyboard, FaTimesCircle } from "react-icons/fa"; +import { FaExpand, FaGamepad, FaKeyboard, FaTerminal, FaTimesCircle } from "react-icons/fa"; const Terminal: VFC = () => { @@ -193,7 +193,7 @@ const Terminal: VFC = () => { const setFocusToTerminal = () => { setTimeout(() => { xtermRef.current?.focus() - }, 500) + }, 100) } useEffect(() => { @@ -258,6 +258,7 @@ const Terminal: VFC = () => { const gamepadHandler = (evt: GamepadEvent) => { if (config?.use_dpad) { console.log('gamepadEvent', evt); + evt.preventDefault(); let command: string | undefined = undefined; switch (evt.detail.button) { @@ -301,16 +302,24 @@ const Terminal: VFC = () => { (!fullScreen) ?

{title}

- + { + !config?.disable_virtual_keyboard ? + : + + }
:
} - -
-
-
+ { + config?.disable_virtual_keyboard && fullScreen ? + : + + } + +
+
); diff --git a/src/pages/settings/SettingsPage.tsx b/src/pages/settings/SettingsPage.tsx index 374aa65..22cd9a6 100644 --- a/src/pages/settings/SettingsPage.tsx +++ b/src/pages/settings/SettingsPage.tsx @@ -114,7 +114,7 @@ import TerminalGlobal from "../../common/global"; + style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '1rem' }}>
Font Family
Change the font of the terminal
@@ -127,7 +127,7 @@ import TerminalGlobal from "../../common/global";
+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '1rem' }}>
Font Size
Change the font size of the terminal
@@ -141,7 +141,7 @@ import TerminalGlobal from "../../common/global";
+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '1rem' }}>
DPad Arrowkeys
Use DPads as arrow key in terminal
@@ -155,10 +155,10 @@ import TerminalGlobal from "../../common/global";
+ style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: '1rem' }}>
Disable Virtual Keyboard
-
Use if you are using external keyboard and don't want virtual keyboard to popup.
(Keyboard button will just move focus to terminal)
+
Use if you don't want virtual keyboard to popup when terminal is clicked or keyboard button is pressed