Skip to content

Instantly share code, notes, and snippets.

@omz
Last active February 9, 2020 02:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omz/4da31445f14b7d5ae86904a855463359 to your computer and use it in GitHub Desktop.
Save omz/4da31445f14b7d5ae86904a855463359 to your computer and use it in GitHub Desktop.
'''
This is a script that you can run in the current App Store version
of Pythonista (once per session) if you have an iPad Pro, and are
suffering from the "extended keys covering the console text" bug.
You'll have to kill the app from the app switcher, in order to
restore the default state (on-screen key row)
'''
from objc_util import *
UIApp = ObjCClass('UIApplication')
import console
@on_main_thread
def main():
app = UIApp.sharedApplication()
cvc = app.windows()[0].rootViewController().accessoryViewController().consoleViewController()
tv = cvc.promptEditorView().textView()
item = tv.inputAssistantItem()
item.setTrailingBarButtonGroups_([])
item.setLeadingBarButtonGroups_([])
console.hud_alert('Extra console keys removed')
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment