Bug 1452097 - Need help info for oc edit about how to use different editor in Windows
Summary: Need help info for oc edit about how to use different editor in Windows
Keywords:
Status: CLOSED EOL
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Maciej Szulik
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-18 10:49 UTC by Xingxing Xia
Modified: 2019-08-21 08:51 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-21 08:51:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xingxing Xia 2017-05-18 10:49:44 UTC
Description of problem:
Need help info for oc edit about how to use different editor in Windows.
Currently `oc edit -h` only simply mentions the usage of OC_EDITOR in Windows:
It will open the editor defined by your OC _EDITOR (**a typo here**), or EDITOR environment variables, or fall back to 'vi' for Linux or 'notepad' for Windows.

But for user who wants to use other editor to process large json file, he may not quickly know how to do, including:
must use `set` instead of `export`;
must set PATH to add the path to editor progra;
must not include quotes in `set OC_EDITOR=editor_program`

So need provide a bit clear such help info in `oc edit -h` and in document https://docs.openshift.com/container-platform/3.5/cli_reference/basic_cli_operations.html#edit

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Xingxing Xia 2017-05-18 10:52:55 UTC
Filed per https://bugzilla.redhat.com/show_bug.cgi?id=1429314#c34

Comment 2 Takayoshi Tanaka 2017-05-19 00:51:47 UTC
I found another issue related to this BZ. When I'd like to use Visual Studio Code for an editor on Windows, it failed to edit. Is there any limitation for the editor to support this feature?


Steps to Reproduce:
1. Install Visual Studio Code and set "code" to the "PATH" environment variable.
https://code.visualstudio.com/download
2. Download oc binary.
3. Execute these command.

> set OC_EDITOR=code
> oc edit bc/<buildconfig>
Edit cancelled, no changed made.

Comment 3 Xingxing Xia 2017-05-19 14:46:37 UTC
My Windows didn't install VS. But I tried Word:
D:\qe\test\versions\oc-3.5.5.16>set PATH=%PATH%;C:\Program Files (x86)\Microsoft Office\Office12

D:\qe\test\versions\oc-3.5.5.16>winword

D:\qe\test\versions\oc-3.5.5.16>set OC_EDITOR=winword

D:\qe\test\versions\oc-3.5.5.16>oc edit dc database
A copy of your changes has been stored to "C:\\Users\\star\\AppData\\Local\\Temp\\oc-edit-ctvgo.yaml"
error: Edit cancelled, no valid changes were saved.

It can open Word to edit but the edit would fail due to Word would prompts MS Word specific format problem when saving the edit.

Not sure if there is something prompted in your VS opening and/or edit saving? About limitation, the default assignee Fabiano may answer you

Comment 4 Maciej Szulik 2019-08-21 08:51:29 UTC
Closing due to age.


Note You need to log in before you can comment on or make changes to this bug.