Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement isterm #87

Merged
merged 25 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7492185
docs: notes about initial implementation
cpendery Nov 16, 2023
d0e4047
chore: partial impl of isterm
cpendery Nov 17, 2023
a4103a0
fix: restore original data echo, clear still breaks
cpendery Nov 17, 2023
314e2f0
fix: adjust incoming backspace so full line delete doesn't happen
cpendery Nov 17, 2023
a9a26a6
fix: term size giving confusing clear issues
cpendery Nov 17, 2023
248d230
fix: handle wrapped text & detecting when output is under prompt
cpendery Nov 18, 2023
8f789e3
feat: add detection for if the cursor is in a suggestable position
cpendery Nov 18, 2023
9cefb45
fix: add resize handler
cpendery Nov 18, 2023
33c1126
fix: bash initial prompt detection & clear conflict
cpendery Nov 18, 2023
b4e57ac
feat: add better debugging logging support to isterm
cpendery Nov 18, 2023
7a98e46
refactor: use es private field syntax
cpendery Nov 18, 2023
5808dea
test: isterm
cpendery Nov 20, 2023
f0321a4
ci: update for node-pty
cpendery Nov 20, 2023
3c49bf4
ci: add pwsh prompt setup for testing
cpendery Nov 20, 2023
cf1e50a
style: fix lint issue
cpendery Nov 20, 2023
0eea00f
ci: try lf to fix issue
cpendery Nov 20, 2023
f3baece
ci: enforce lf via gitattributes
cpendery Nov 20, 2023
7fe8798
ci: tweak config
cpendery Nov 20, 2023
539c57b
ci: rollback types upgrade
cpendery Nov 20, 2023
4d510cc
ci: drop macos builds for now
cpendery Nov 20, 2023
7a40e4e
ci: disable logging
cpendery Nov 20, 2023
247ede0
test: unix shells
cpendery Nov 20, 2023
2bfbe22
ci: use step conditions
cpendery Nov 20, 2023
37eba58
ci: use condition for pwsh setup
cpendery Nov 20, 2023
1eff2f5
ci: disable isterm tests
cpendery Nov 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
93 changes: 65 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,65 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["16.x", "18.x", "20.x"]
steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- run: npm ci

- run: npm run lint

- run: npm test

- run: npm run build
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
strategy:
matrix:
os: ["windows-latest", "ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- run: npm ci

- run: npm run lint

- name: setup pwsh prompt
shell: pwsh
if: matrix.os == 'windows-latest'
run: |
New-Item -Path $profile -ItemType File -Force
Set-Content $profile 'function prompt {'
Add-Content $profile ' $prompt = "PS: $(get-date)> "'
Add-Content $profile ' return "`e]6973;PS`a$prompt`e]6973;PE`a"'
Add-Content $profile '}'
- name: setup powershell prompt
if: matrix.os == 'windows-latest'
shell: powershell
run: |
New-Item -Path $profile -ItemType File -Force
Set-Content $profile 'function prompt {'
Add-Content $profile ' $ESC = [char]27'
Add-Content $profile ' $BEL = [char]7'
Add-Content $profile ' $prompt = "PS: $(Get-Location)> "'
Add-Content $profile ' return "$ESC]6973;PS$BEL$prompt$ESC]6973;PE$BEL"'
Add-Content $profile '}'
- name: setup fish prompt
if: matrix.os != 'windows-latest'
shell: bash
run: |
mkdir -p ~/.config/fish/functions && touch ~/.config/fish/functions/fish_prompt.fish
echo "function fish_prompt -d \"Write out the prompt\"" >> ~/.config/fish/functions/fish_prompt.fish
echo " printf '\033]6973;PS\007%s@%s %s%s%s > \033]6973;PE\007' $USER $hostname (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)" >> ~/.config/fish/functions/fish_prompt.fish
echo "end" >> ~/.config/fish/functions/fish_prompt.fish
- name: setup zsh-autosuggestions
if: matrix.os != 'windows-latest'
shell: bash
run: |
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
echo "source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh" > ~/.zshrc
- run: npm test
- run: npm run build
41 changes: 40 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@
"commander": "^11.0.0",
"find-process": "^1.4.7",
"ink": "^4.4.1",
"node-pty": "^1.0.0",
"react": "^18.2.0",
"wrap-ansi": "^8.1.0"
"wrap-ansi": "^8.1.0",
"xterm-headless": "^5.3.0"
},
"devDependencies": {
"@tsconfig/node18": "^18.2.2",
Expand Down
Loading