Skip to content

Commit

Permalink
refactor: revert to "[c] to copy"
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbrayo committed Nov 1, 2024
1 parent 5c95dd7 commit a96b652
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions gptme/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import functools
import re
import sys
import tty
import termios
import textwrap
from datetime import datetime, timedelta
Expand Down Expand Up @@ -360,15 +359,3 @@ def get_installed_programs(candidates: tuple[str, ...]) -> set[str]:
if shutil.which(candidate) is not None:
installed.add(candidate)
return installed

def listen_for_character():
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
except KeyboardInterrupt:
ch = "\x03" # ASCII code for Ctrl+C
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch

0 comments on commit a96b652

Please sign in to comment.