Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export readline forced_update_display #67256

Open
dexteradeus mannequin opened this issue Dec 16, 2014 · 4 comments
Open

Export readline forced_update_display #67256

dexteradeus mannequin opened this issue Dec 16, 2014 · 4 comments
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@dexteradeus
Copy link
Mannequin

dexteradeus mannequin commented Dec 16, 2014

BPO 23067
Nosy @vadmium
Files
  • readline_redisplay_force.patch
  • test-rdline.py: readline test example
  • readline_add_forced_update_display.patch: Another way to fix the problem (patch)
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2014-12-16.19:29:14.720>
    labels = ['extension-modules', 'type-feature']
    title = 'Export readline forced_update_display'
    updated_at = <Date 2015-08-02.01:23:39.198>
    user = 'https://bugs.python.org/dexteradeus'

    bugs.python.org fields:

    activity = <Date 2015-08-02.01:23:39.198>
    actor = 'martin.panter'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2014-12-16.19:29:14.720>
    creator = 'dexteradeus'
    dependencies = []
    files = ['37473', '38162', '38163']
    hgrepos = []
    issue_num = 23067
    keywords = ['patch']
    message_count = 4.0
    messages = ['232757', '236147', '236148', '247847']
    nosy_count = 3.0
    nosy_names = ['martin.panter', 'dexteradeus', 'zer0']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue23067'
    versions = ['Python 3.6']

    @dexteradeus
    Copy link
    Mannequin Author

    dexteradeus mannequin commented Dec 16, 2014

    The current implementation of readline implements the redisplay function, but not the forced version. This patch maintains the current behavior as the default, but also allows a bool to be passed which, if True, calls rl_forced_update_display instead.

    @dexteradeus dexteradeus mannequin added extension-modules C modules in the Modules dir type-feature A feature request or enhancement labels Dec 16, 2014
    @zer0
    Copy link
    Mannequin

    zer0 mannequin commented Feb 17, 2015

    Hi,

    I'm also interrested in this feature. Indeed, exporting rl_forced_update_display() is the only way I've found to make readline.set_completion_display_matches_hook() working properly. Without forcing the redisplay, the prompt is not displayed. This seems to be the proper function to call, because that's the one called at the end of display_matches() in libreadline code, which is the default function for displaying matches.

    The attached file is a simple example code derived from http://pymotw.com/2/readline/ that shows that the patch is working.

    @zer0
    Copy link
    Mannequin

    zer0 mannequin commented Feb 17, 2015

    By the way, I have my own implementation of the patch that did before checking the issue tracker. Instead of adding an argument to readline.redisplay(), it adds a new function readline.forced_update_display().

    I attach the patch for reference, I don't know what is the preferred way to add this feature.

    @vadmium
    Copy link
    Member

    vadmium commented Aug 2, 2015

    There are actually a few other patches open adding wrappers for rl_forced_update_display():

    As well as the documentation, I think it would be good to add a test case for new functionality if possible.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant