From c3c2c787364a7e5fa8bf90adad7d6cffb627eb8b Mon Sep 17 00:00:00 2001 From: Muaz Ahmad Date: Thu, 15 Dec 2022 14:10:41 +0500 Subject: [PATCH] Fixed incorrect item being selected --- tui.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tui.py b/tui.py index d2c7e46..f6cbbc3 100644 --- a/tui.py +++ b/tui.py @@ -3,6 +3,7 @@ import requests import curses, curses.textpad import subprocess, sys, json + class Session(): def __init__(self): self.client = requests.Session() @@ -115,7 +116,8 @@ class App(): x = self.root.getch() if x == 10: - self.selected_item = self.items[self.root.getyx()[0] - 4] + subprocess.run(f'echo \'{self.gui.results_box.getyx()}\' | xclip -sel c', shell = True) + self.selected_item = self.items[self.gui.results_box.getyx()[0] - 1] self.update_orders_results() self.state = 2 else: