()
Remove tab autocompletion from your shell profile.
Remove tab autocompletion from your shell profile.
Remove tab autocompletion from your shell profile .
def uninstall_autocomplete() -> None:
    """
    Remove tab autocompletion from your shell profile.
    """
    path, text = _validate_shell()

    # Removes "{text}\n" from file; however, it leaves the preceding newline.
    # This is simply because the logic got complicated otherwise.

    omit_next_newline = False
    swap_fd, swap_path = tempfile.mkstemp(prefix="path_", text=True)
    try:
        with path.open() as profile_fd:
            for line in profile_fd:
                if line.strip() == text:
                    omit_next_newline = True
                elif omit_next_newline and line == "\n":
                    omit_next_newline = False
                else:
                    omit_next_newline = False
                    os.write(swap_fd, line.encode())
        os.fsync(swap_fd)
        shutil.copyfile(swap_path, path)
    finally:
        os.close(swap_fd)
        os.remove(swap_path)

    echo_success(f"Tab autocompletion for Bento has been removed from {path}.")
def uninstall_autocomplete ( ) -> None : path , text = _validate_shell ( ) # Removes "{text}\n" from file; however, it leaves the preceding newline. # This is simply because the logic got complicated otherwise. omit_next_newline = False swap_fd , swap_path = tempfile . mkstemp ( prefix = "path_" , text = True ) try : with path . open ( ) as profile_fd : for line in profile_fd : if line . strip ( ) == text : omit_next_newline = True elif omit_next_newline and line == "\n" : omit_next_newline = False else : omit_next_newline = False os . write ( swap_fd , line . encode ( ) ) os . fsync ( swap_fd ) shutil . copyfile ( swap_path , path ) finally : os . close ( swap_fd ) os . remove ( swap_path ) echo_success ( f"Tab autocompletion for Bento has been removed from {path}." )