about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--saneterm/history.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/saneterm/history.py b/saneterm/history.py
index 038a4f9..29e0c34 100644
--- a/saneterm/history.py
+++ b/saneterm/history.py
@@ -73,7 +73,7 @@ class History():
         self.__cur.execute("""
                 SELECT entry FROM history WHERE exe=:exe AND
                     ( SELECT count(*) FROM history WHERE exe=:exe ) >= :offset
-                    LIMIT 1 OFFSET
+                    ORDER BY rowid ASC LIMIT 1 OFFSET
                     (( SELECT count(*) FROM history WHERE exe=:exe ) - :offset);
                 """, {"exe": exe, "offset": offset})