Title: Out-Host -Paging does not pause on long strings or clean up after itself · Issue #7851 · PowerShell/PowerShell · GitHub
Open Graph Title: Out-Host -Paging does not pause on long strings or clean up after itself · Issue #7851 · PowerShell/PowerShell
X Title: Out-Host -Paging does not pause on long strings or clean up after itself · Issue #7851 · PowerShell/PowerShell
Description: Per the comment on #4962, paging was at some point intended to be fixed by 6.1.0 -- this is not the case, as such. Checking the contents of $function:help indicates that some effort was made for the help system specifically (it utilises ...
Open Graph Description: Per the comment on #4962, paging was at some point intended to be fixed by 6.1.0 -- this is not the case, as such. Checking the contents of $function:help indicates that some effort was made for th...
X Description: Per the comment on #4962, paging was at some point intended to be fixed by 6.1.0 -- this is not the case, as such. Checking the contents of $function:help indicates that some effort was made for th...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/7851
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Out-Host -Paging does not pause on long strings or clean up after itself","articleBody":"Per the [comment](https://github.com/PowerShell/PowerShell/issues/4962#issuecomment-333342220) on #4962, paging was at some point intended to be fixed by 6.1.0 -- this is not the case, as such.\r\n\r\nChecking the contents of `$function:help` indicates that *some* effort was made for the help system specifically (it utilises `less` on Linux, and `more.com` on Windows), but `Out-Host -Paging` does... nothing, in those cases (long strings of text aren't interrupted to page, etc.)\r\n\r\nIt *does* work with lengthy sequences of objects, *but* even there the paging is... not at all pretty. Unlike how `more` or `less` function, it leaves... useless prompt strings in the host display after they've been skipped past, duplicates the prompt after the first full page, and overall doesn't make enough of an effort to distinguish itself from the rest of the output, in my opinion. Image is below; partial host output from a call to `gci c:\\ -recurse -depth 2 | out-host -paging`\r\n\r\n\r\n\r\n`Out-Host -Paging` should mimic the behaviour of `more` and `less`. As [this unfortunate soul discovered](https://www.reddit.com/r/PowerShell/comments/9hyh8v/i_must_have_screwed_up_more_literally/e6he82z/?context=3) `more.com` does have cases where it *completely breaks* non-Latin character encodings (though it is perfectly capable of reading them from a file). \r\n\r\nAnd, arguably, the `more` function should return as a function that simply maps to `Out-Host -Paging`\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\n# windows\r\ngci c:\\ -recurse -depth 2 | out-host -Paging\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n*similar behaviour to `more.com` or `less`*\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\n\r\n\r\n Directory: C:\\\r\n\r\n\r\nMode LastWriteTime Length Name\r\n---- ------------- ------ ----\r\nd----- 7/1/2018 12:33 AM 8336500659725115574\r\nda---- 8/16/2016 4:57 PM adb\r\nd----- 9/16/2018 6:40 PM AMD\r\nda---- 9/9/2016 11:27 AM Android\r\nd----- 9/24/2015 5:38 PM EFI\r\nd----- 4/7/2018 6:39 PM ESD\r\nd----- 3/16/2015 1:35 AM Intel\r\nd----- 5/3/2018 6:48 PM Logs\r\nd----- 9/27/2015 11:57 PM My Backups\r\nd----- 9/8/2018 5:23 AM PerfLogs\r\nd-r--- 9/16/2018 6:39 PM Program Files\r\nd-r--- 9/16/2018 6:39 PM Program Files (x86)\r\nd----- 3/17/2015 9:12 PM Python34\r\nd----- 9/4/2017 8:34 PM Ruby24-x64\r\nd----- 7/6/2018 1:23 PM test\r\nd-r--- 9/16/2018 6:39 PM Users\r\nd----- 11/29/2016 12:32 AM VIA_XHCI\r\nd----- 9/16/2018 6:46 PM Windows\r\nd----- 9/16/2018 6:48 PM Windows.old\r\nd----- 6/1/2018 12:28 AM Windows.old(1)\r\n-a---- 3/17/2015 5:49 AM 4194304 BIOS.17.03.15.bak\r\n-a---- 4/6/2018 6:05 PM 17005 PS5.1help.csv\r\n-a---- 4/6/2018 6:04 PM 5535 PSCoreHelp.csv\r\n-a---- 4/6/2018 6:22 PM 328 WinPSTopics.txt\r\n\r\n\r\n Directory: C:\\adb\r\n\r\n\r\nMode LastWriteTime Length Name\r\n---- ------------- ------ ----\r\n-a---- 10/9/2015 5:58 PM 944128 adb.exe\r\n-a---- 10/9/2015 5:58 PM 96256 AdbWinApi.dll\r\n-a---- 10/9/2015 5:58 PM 60928 AdbWinUsbApi.dll\r\n-a---- 10/9/2015 5:58 PM 318464 fastboot.exe\r\n\r\n\r\n Directory: C:\\AMD\r\n\r\n\r\nMode LastWriteTime Length Name\r\n---- ------------- ------ ----\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\nd----- 2/4/2018 11:12 AM Packages\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\nd----- 12/12/2017 8:43 PM PPC\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\nd----- 2/4/2018 11:12 AM radeon-software-adrenalin-18.2.1-minimalsetup-180201_64bit\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\nd----- 12/12/2017 8:36 PM Win10-64Bit-Radeon-Software-Adrenalin-Edition-17.12.1-Dec11\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\nd----- 9/16/2018 6:40 PM WU-CCC2\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\n-a---- 2/4/2018 9:20 AM 2647 atikmdag_dce.log\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\n\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\n\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\n Directory: C:\\AMD\\Packages\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\n\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\n\r\n\u003cSPACE> next page; \u003cCR> next line; Q quit\r\n```\r\n\r\nLots of added clutter that does not clean up after itself.\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\n> $PSVersionTable\r\n\r\nName Value\r\n---- -----\r\nPSVersion 6.1.0\r\nPSEdition Core\r\nGitCommitId 6.1.0\r\nOS Microsoft Windows 10.0.17758\r\nPlatform Win32NT\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n","author":{"url":"https://github.com/vexx32","@type":"Person","name":"vexx32"},"datePublished":"2018-09-23T12:24:03Z","url":"https://github.com/PowerShell/PowerShell/issues/7851"}
| 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:40982f40-c9b5-2ed7-914b-83c6004bd1bc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BB7E:2B4DE7:28D39F:39BC09:6AFD55EF |
| html-safe-nonce | cd597f2aa2766d96241e45e000e24147831b1d91ded77cbd3add22fa41ab88b6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjdFOjJCNERFNzoyOEQzOUY6MzlCQzA5OjZBRkQ1NUVGIiwidmlzaXRvcl9pZCI6Ijc3MzE3MTE1NTI5NDM2NDIwOTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f945ff0c6bcc8d0d50992ffb85cdc2c66de1bf385f4b2a21e1020336e7bc5d29 |
| hovercard-subject-tag | issue:362938482 |
| 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/PowerShell/PowerShell/7851/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d36537d1022b4e48899273d5d8d97349ecaab83db937bbe71eb593814b508709/PowerShell/PowerShell/issues/7851 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d36537d1022b4e48899273d5d8d97349ecaab83db937bbe71eb593814b508709/PowerShell/PowerShell/issues/7851 |
| og:image:alt | Per the comment on #4962, paging was at some point intended to be fixed by 6.1.0 -- this is not the case, as such. Checking the contents of $function:help indicates that some effort was made for th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vexx32 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| 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 | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width