{"action":"created","issue":{"url":"https://api.github.com/repos/krockode/x_x/issues/13","labels_url":"https://api.github.com/repos/krockode/x_x/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/krockode/x_x/issues/13/comments","events_url":"https://api.github.com/repos/krockode/x_x/issues/13/events","html_url":"https://github.com/krockode/x_x/issues/13","id":64672383,"number":13,"title":"Moving from less to curses in order to display wide tables?","user":{"login":"jackmaney","id":1554625,"avatar_url":"https://avatars.githubusercontent.com/u/1554625?v=3","gravatar_id":"","url":"https://api.github.com/users/jackmaney","html_url":"https://github.com/jackmaney","followers_url":"https://api.github.com/users/jackmaney/followers","following_url":"https://api.github.com/users/jackmaney/following{/other_user}","gists_url":"https://api.github.com/users/jackmaney/gists{/gist_id}","starred_url":"https://api.github.com/users/jackmaney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackmaney/subscriptions","organizations_url":"https://api.github.com/users/jackmaney/orgs","repos_url":"https://api.github.com/users/jackmaney/repos","events_url":"https://api.github.com/users/jackmaney/events{/privacy}","received_events_url":"https://api.github.com/users/jackmaney/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-27T01:45:54Z","updated_at":"2015-04-06T02:13:36Z","closed_at":null,"body":"*Note:* This is just a question, and implementing it would require a complete rewrite of the `draw` functionality. So, if you're not interested, I understand.\r\n\r\nSince so many Excel files and CSVs are too wide to fit reasonably in one screen (without wrapping), I believe we could scrap the piped out call to `less` and replace the view portion of the app with a curses application. I have no experience with curses directly, but glancing through [this tutorial for the `curses` package](https://docs.python.org/3.4/howto/curses.html#curses-howto), it appears as though we can:\r\n\r\n* Replace the `termsize` function with a call to `getmaxyx` on a `curses` window (testing on my system gave me the same sizes).\r\n* Load the entire table into a `pad`, and keep the window coordinates of each cell, so that, eg:\r\n    * Pressing the right or left arrows will move right or left one column (respectively)\r\n    * Pressing the up or down arrows will move up or down one row (respectively)\r\n    * Pressing the space bar will move down one page\r\n* I believe we can even keep track of the portion of the header that needs to be displayed, and automatically display it on the top of the screen with each window refresh.\r\n\r\nOne drawback is that it would be a non-trivial endeavor to implement the rest of the `less` functionality (eg regex searches). However, since the aim of this app is to get a basic view of data, that loss might be worth it in exchange for scrolling to the left and right.\r\n\r\nThoughts?\r\n"},"comment":{"url":"https://api.github.com/repos/krockode/x_x/issues/comments/89890326","html_url":"https://github.com/krockode/x_x/issues/13#issuecomment-89890326","issue_url":"https://api.github.com/repos/krockode/x_x/issues/13","id":89890326,"user":{"login":"jackmaney","id":1554625,"avatar_url":"https://avatars.githubusercontent.com/u/1554625?v=3","gravatar_id":"","url":"https://api.github.com/users/jackmaney","html_url":"https://github.com/jackmaney","followers_url":"https://api.github.com/users/jackmaney/followers","following_url":"https://api.github.com/users/jackmaney/following{/other_user}","gists_url":"https://api.github.com/users/jackmaney/gists{/gist_id}","starred_url":"https://api.github.com/users/jackmaney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackmaney/subscriptions","organizations_url":"https://api.github.com/users/jackmaney/orgs","repos_url":"https://api.github.com/users/jackmaney/repos","events_url":"https://api.github.com/users/jackmaney/events{/privacy}","received_events_url":"https://api.github.com/users/jackmaney/received_events","type":"User","site_admin":false},"created_at":"2015-04-06T02:13:36Z","updated_at":"2015-04-06T02:13:36Z","body":"I haven't forgotten about this, by the way...just been busy with work and life.\r\n\r\nI'll see if I can make some progress later this week."}}