Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read-only mode (viewer mode) when called as "rox" or with -r #48

Closed
vlisivka opened this issue Nov 3, 2020 · 4 comments
Closed

Read-only mode (viewer mode) when called as "rox" or with -r #48

vlisivka opened this issue Nov 3, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@vlisivka
Copy link

vlisivka commented Nov 3, 2020

Is your feature request related to a problem? Please describe.
It's better to use the same editor both as editor and as viewer or pager (e.g. as replacement for less). To use ox as viewer, readonly mode must be supported.

Describe the solution you'd like
When ox is invoked as "rox", it should read content of file from stdin or from file, if specified, and display it in readonly mode.

Describe alternatives you've considered
Currently, less or vim are used as pager.

@curlpipe
Copy link
Owner

curlpipe commented Nov 3, 2020

This is an interesting idea, I do want to add a read only mode for files that aren't able to be written to due to permissions or other factors and will consider adding a way to use this from the command line interface. :)

@zen2
Copy link

zen2 commented Nov 5, 2020

Note: that should be an option like '-r' and user can alias it as "rox" because rox is already to launch file manager ROX-Filer.

@curlpipe curlpipe added the enhancement New feature or request label Nov 6, 2020
@curlpipe
Copy link
Owner

I've added a read only mode that will open a text file and not allow any edits in 0.2.7 but I will further this feature to allow input from the stdin in later versions, probably the next one.

@curlpipe
Copy link
Owner

Implemented in Ox 0.3.3

You can use the -r flag to open files as read only
Passing information from stdin can be done as follows (as an example):

tree | ox --stdin -r (to dump the output of the tree command into a readonly ox document)
or
ox --stdin <<< "some string" (redirecting some string into ox via stdin)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants