summary refs log tree commit diff stats
path: root/ranger.py
blob: fbceab23308efdce6c201c3ea65252189e6279ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/python -O
# coding=utf-8
#
# Ranger: Explore your forest of files from inside your terminal
# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Embed a script which allows you to change the directory of the parent shell
# after you exit ranger.  Run it with the command: source ranger ranger
"""":
if [ $1 ]; then
	$@ --fail-unless-cd &&
	if [ -z "$XDG_CONFIG_HOME" ]; then
		cd "$(grep \^\' ~/.config/ranger/bookmarks | cut -b3-)"
	else
		cd "$(grep \^\' "$XDG_CONFIG_HOME"/ranger/bookmarks | cut -b3-)"
	fi && return 0
else
	echo "usage: source path/to/ranger.py path/to/ranger.py"
fi
return 1
"""

import sys

# When using the --clean option, not even bytecode should be written.
# Need to find out if --clean is used as soon as possible.
try:
	argv = sys.argv[0:sys.argv.index('--')]
except:
	argv = sys.argv
sys.dont_write_bytecode = '-c' in argv or '--clean' in argv

# Set the actual docstring
__doc__ = """Ranger - file browser for the unix terminal"""

# Start ranger
import ranger
sys.exit(ranger.main())
@gmail.com> 2023-06-26 21:51:09 +0200 committer bptato <nincsnevem662@gmail.com> 2023-06-26 21:51:09 +0200 import todo list' href='/ahoang/chawan/commit/todo?id=719ee428aeac1d25f85f4b75812354a23acb768d'>719ee428 ^
4511c956 ^
719ee428 ^





719ee428 ^


2d414c2b ^
719ee428 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
            
                                         




                                                                              





                                                                           
                             




                                                                        

                          


                                                                    











                                                                             












                                                                               
                                                       

                                                             
         



                                                     
                                             

                                             


                                                                        
                               
                                  
                                        
                  
              






                                                                               

                                                                          

                                                    


                                                     
        





                                                                          


                                                                                         
             
                                                           
compilation:
- reduce binary size (maybe gzip data/*?)
- improve compilation times (it's sloooow... we could probably speed up the js
  macros somehow, also the html parser/tokenizer?)
charsets:
- set up some fuzzer
- use appropriate charsets in forms, urls, etc.
display:
- important: add a virtual cursor (in some terminals, the real cursor is
  often obscured by white background color)
- important: buffer list
	* either a buffer list buffer, or a buffer list popup menu. ideally
	  both.
- dark mode (basically max Y)
- do not assume default background color
	* instead, add an "override-default-color" option that is set to
	  true by default and replaces default bgcolor/fgcolor with
	  default-background/foreground-color
- allow overriding ansi colors
config:
- important: config editor
- better path handling
	* e.g. expand tilde for all paths on load, allow environment
	  variables/shell substitution, etc.
buffer:
- important: incremental html parsing
	* also, do not needlessly copy in onload
- important: validate returned values
	* do not block container when receiving buffer data; if invalid, kill
	  buffer
	* this also includes not crashing when the buffer dies while
	  container is reading...
- important: add sandboxing
	* also, other security stuff:
		- configurable/better url filtering in loader
		- make peekCursor show the entire url
- when the log buffer crashes, print its contents to stderr
	* make console.err a TeeStream, and tee it to a StringStream that
	  buffers up to 4KB
- add highlighting, copy
- add buffer groups
- add option to write source to a file, instead of keeping it in memory
- hex viewer
- xhtml
- better horizontal line handling: allow viewing content positioned before page
  start, handle long lines, etc
- do not prompt when submitting forms (it's annoying)
	* this is mostly fixed, but not completely
network:
- uBO integration? (or at least implement filter lists)
- websockets (curl supports ws)
- integrate curl-impersonate (LD_PRELOAD works, but still...)
external:
- history, bookmarks (w3m format)
- save buffer (source, output)
- edit buffer (local file, or whatever we downloaded)
javascript:
- important: callbacks should not leak memory
- add support for JS mixins
- distinguish double from unrestricted double
- better dom support, more events
	* more concretely: get jQuery to work. this needs innerHTML, CSS
	  properties in DOM, ...
- implement ReadableStream, XHR
- separate console for each buffer
	* also, do not crash on / -> M-c
- buffer selection
layout engine:
- important: clear (to complete float support)
- fix conflict in renderdocument Y error correction and floats
	* if too many line breaks are done because of floats, Y error
	  correction will happily arrange the lines on top of the floating box
- make table width calculation consistent with FF etc.
	* unfortunately, most websites are designed for auto table layouts
	  where w3m's space distribution algorithm does not work really well :/
- make background-color a property of inline boxes, not words. (this would
  require implementing actual inline boxes)
- table layout: include caption in width calculation
- details element
- overflow
- incremental layout & layout caching
	* first for tree generation, then for layout.
- iframe
- writing-mode, flexbox, grid, ruby, ... (i.e. cool new stuff)
images:
- sixel encoding (eventually also kitty)
- more formats (apng, gif: write own decoders, jpeg: use libjpeg, webp: ?)
- incremental decoding (maybe implement streams first?)
- separate image decoder process? or just run on a different thread?
etc:
- important: replace fastRuneAt with qjs libunicode (fastRuneAt has no error handling...)
- tests (including aforementioned fuzzer)
- orc support
- maybe windows support? (blocker: needs a windows machine)