mumu-lhl / eaf-pyqterminal

A terminal written in PyQt6 for the Emacs Application Framework.
GNU General Public License v3.0
46 stars 3 forks source link

滚动事件支持 #9

Closed manateelazycat closed 1 year ago

manateelazycat commented 1 year ago

外部终端有个特性可以很好的支持用户查看输出历史:

  1. 用户一旦触发滚动事件以后, 终端命令持续输出不滚动屏幕, 让用户可以 固定 在某个Y坐标, 稳定查看终端输出历史
  2. 用户滚动到最底部时, 上面这个限制解除, 终端命令输出就会自动向下滚动屏幕

当前的状态是, 用户滚动到顶部查看日志后, 命令一旦输出, 屏幕就滚动到最底部, 用户没法查看终端输出历史

manateelazycat commented 1 year ago

现在用 self.backend.screen.history.bottom.maxlen <= self.backend.screen.history.position 可以判断光标是否在可视区域。

结合这个条件, 只要在命令行输出的函数做个判断就可以解决这个 issue.

mumu-lhl commented 1 year ago

4e28101 中已经支持了这一特性,但是滚动的跨度有点大

manateelazycat commented 1 year ago

很好用!