Skip to content

Commit

Permalink
fix: linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex4386 committed Mar 16, 2024
1 parent f55c50d commit 6567c52
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/pages/Terminal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from "decky-frontend-lib";
import { VFC, useRef, useState, useEffect } from "react";
import { Terminal as XTermTerminal } from 'xterm';
import { AttachAddon } from "xterm-addon-attach";
import { AttachAddon } from 'xterm-addon-attach';
import { FitAddon } from 'xterm-addon-fit';
import TerminalGlobal from "../common/global";
import XTermCSS from "../common/xterm_css";
Expand Down Expand Up @@ -235,9 +235,9 @@ const Terminal: VFC = () => {
const res = fitAddon.proposeDimensions();
if (res?.rows && res.cols) {
const colOffset = (Math.ceil(30 / xterm.options.fontSize));

if (isFullScreen) xterm.resize(res.cols - colOffset, res.rows - 1)
else xterm.resize(res.cols + colOffset, res.rows)
//
}

console.log('triggered fit!', xtermRef.current?.cols, xtermRef.current?.rows)
Expand Down Expand Up @@ -343,6 +343,21 @@ const Terminal: VFC = () => {
<Focusable onClick={openKeyboard} style={{boxSizing: 'content-box'}}>
<div ref={xtermDiv} style={{ width: '100%', maxWidth: '100vw', margin: 0, background: '#000', padding: 0, height: "calc(100vh - "+getPadding()+")" }}></div>
</Focusable>

{
true &&
<div style={{ display: 'flex', justifyContent: 'center', gap: '1rem', padding: '1rem 0' }}>
<DialogButton onClick={() => wsRef.current?.send('\x1b[A')}></DialogButton>
<DialogButton onClick={() => wsRef.current?.send('\x1b[B')}></DialogButton>
<DialogButton onClick={() => wsRef.current?.send('\x1b[D')}></DialogButton>
<DialogButton onClick={() => wsRef.current?.send('\x1b[C')}></DialogButton>

<DialogButton onClick={() => wsRef.current?.send('\x03')}>^C</DialogButton>
<DialogButton onClick={() => wsRef.current?.send('\x04')}>^C</DialogButton>
<DialogButton onClick={() => wsRef.current?.send('\x1a')}>^Z</DialogButton>
</div>
}

{
config?.handheld_mode &&
<Focusable style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', paddingTop: fullScreen ? '1em' : '2em' }}>
Expand Down
6 changes: 6 additions & 0 deletions src/pages/settings/AcknowledgementPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ import {
<p>&nbsp;</p>
<p>The source code of this plugin is available at:</p>
<p>https://github.com/Alex4386/decky-terminal</p>
<p>&nbsp;</p>
<p>DeckyTerminal is possible thanks to following contributors:</p>
<ul>
<li><b>Alex4386</b>: Main Developer</li>
<li><b>Gadgetoid</b>: Refactored Python backend</li>
</ul>
</Focusable>
);
};
Expand Down

0 comments on commit 6567c52

Please sign in to comment.