IngoMeyer441 / simple-term-menu

A Python package which creates simple interactive menus on the command line.
MIT License
492 stars 43 forks source link

When using CJK text as the preview title, the display is misplaced #79

Closed yetist closed 11 months ago

yetist commented 1 year ago

Here's the test code:

#!/usr/bin/env python3

import os
from simple_term_menu import TerminalMenu

def list_files(directory="."):
    return (file for file in os.listdir(directory) if os.path.isfile(os.path.join(directory, file)))

def main():
    terminal_menu = TerminalMenu(list_files(), preview_title="预览",  preview_command="cat {}", preview_size=0.75)
    menu_entry_index = terminal_menu.show()

if __name__ == "__main__":
    main()

The display effect:

image

IngoMeyer441 commented 11 months ago

Thanks again for your fix in #80. :smiley: