Title: [Bug]: matplotlib figures inhibit `input` longer than 100 chars in IPython · Issue #25756 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: matplotlib figures inhibit `input` longer than 100 chars in IPython · Issue #25756 · matplotlib/matplotlib
X Title: [Bug]: matplotlib figures inhibit `input` longer than 100 chars in IPython · Issue #25756 · matplotlib/matplotlib
Description: Bug summary After matplotlib activates a plot in IPython, input behavior is changed. In particular, input longer than 100 characters is no longer directly accepted. Since IPython uses input in its REPL loop when --simple-prompt is set, t...
Open Graph Description: Bug summary After matplotlib activates a plot in IPython, input behavior is changed. In particular, input longer than 100 characters is no longer directly accepted. Since IPython uses input in its ...
X Description: Bug summary After matplotlib activates a plot in IPython, input behavior is changed. In particular, input longer than 100 characters is no longer directly accepted. Since IPython uses input in its ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/25756
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: matplotlib figures inhibit `input` longer than 100 chars in IPython","articleBody":"### Bug summary\r\n\r\nAfter matplotlib activates a plot in IPython, `input` behavior is changed. In particular, input longer than 100 characters is no longer directly accepted. Since IPython uses `input` in its REPL loop when `--simple-prompt` is set, this defeats various modes (such as Emacs) which use this.\r\n\r\n### Code for reproduction\r\n\r\n```python\r\n% python3 -m IPython --simple-prompt\r\nPython 3.11.3 (main, Apr 7 2023, 19:29:16) [Clang 14.0.0 (clang-1400.0.29.202)]\r\nType 'copyright', 'credits' or 'license' for more information\r\nIPython 8.12.0 -- An enhanced Interactive Python. Type '?' for help.\r\n\r\nIn [1]: input('Test1: '); print(\"success!\")\r\nTest1: avaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravar=3\r\nsuccess!\r\n\r\nIn [2]: import matplotlib.pyplot as plt; plt.plot([1])\r\nInstalled osx event loop hook.\r\nOut[2]: [\u003cmatplotlib.lines.Line2D at 0x10a704a10>]\r\n\r\nIn [3]: input('Test2: '); print(\"success!\")\r\nTest2: avaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravaravar=3\r\n# Return does not send the input\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\nTo send the input, an additional newline is required, which is then interpreted as an additional (blank) command. Commands shorter than 100 characters are still directly accepted.\r\n\r\n### Expected outcome\r\n\r\nPython's native `input` should work the same in IPython before and after activating a matplotlib figure, for arbitrary command lengths (up to the terminals line length limit). \r\n\r\n### Additional information\r\n\r\nIssue posted with IPython as well: ipython/ipython#14030. I have tested disabling `enable_gui`, but this is not the culprit. To see the bug, you must actually create a figure (but do not need to show it). This does not occur in regular `python` sessions, only IPython (and possibly only on MacOS?).\r\n\r\n### Operating system\r\n\r\nMacOS 12.6\r\n\r\n### Matplotlib Version\r\n\r\n3.7.1 (same behavior on various versions back to 3.4)\r\n\r\n### Matplotlib Backend\r\n\r\nMacOSX (though same behavior with other backends, e.g. qt6)\r\n\r\n### Python version\r\n\r\n3.11.3 (same behavior back to 3.9)\r\n\r\n### Jupyter version\r\n\r\nn/a\r\n\r\n### Installation\r\n\r\npip","author":{"url":"https://github.com/jdtsmith","@type":"Person","name":"jdtsmith"},"datePublished":"2023-04-23T16:54:12Z","url":"https://github.com/matplotlib/matplotlib/issues/25756"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:055700b2-2747-9f37-3a87-9ad16ef4f435 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE04:2429C1:62C215:7BB747:6B024A9D |
| html-safe-nonce | 3fe0852f4242d4086d6108b443e29b9965061a7e8aa2efba6a87149941c342b7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTA0OjI0MjlDMTo2MkMyMTU6N0JCNzQ3OjZCMDI0QTlEIiwidmlzaXRvcl9pZCI6Ijg4NTU2OTA4OTIxNDU3NDA0NDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a8facecb4d55e154e046ffd30542132dc83290edd614272b887dc66ccb45675f |
| hovercard-subject-tag | issue:1680092658 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/25756/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d4e9cf9c71612e4e4fb4b62248924ec4311e64e307130e7a609eec0914674e62/matplotlib/matplotlib/issues/25756 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d4e9cf9c71612e4e4fb4b62248924ec4311e64e307130e7a609eec0914674e62/matplotlib/matplotlib/issues/25756 |
| og:image:alt | Bug summary After matplotlib activates a plot in IPython, input behavior is changed. In particular, input longer than 100 characters is no longer directly accepted. Since IPython uses input in its ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jdtsmith |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width