Skip to content

docs: document opening a file at a line via the payload query parameter - #7909

Merged
code-asher merged 1 commit into
coder:mainfrom
Grynn:docs-open-file-via-url
Jul 30, 2026
Merged

docs: document opening a file at a line via the payload query parameter#7909
code-asher merged 1 commit into
coder:mainfrom
Grynn:docs-open-file-via-url

Conversation

@Grynn

@Grynn Grynn commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Relates to #1964.

What

Adds an FAQ entry documenting how to open a specific file — optionally at a line and column — directly from a URL, using the payload query parameter (openFile + gotoLineMode) alongside the existing folder parameter.

Why

#1964 ("Ability to open a file directly using a URL") has been open since 2020 and is in the backlog, but the capability already exists: code-server inherits upstream VS Code web's payload query parameter, so no new patch is needed — it just isn't documented anywhere. The FAQ currently only mentions workspace and folder.

Verified working on code-server 4.122.1 behind a reverse proxy:

https://<host>/?folder=/tmp&payload=%5B%5B%22gotoLineMode%22%2C%22true%22%5D%2C%5B%22openFile%22%2C%22vscode-remote%3A%2F%2F%3Chost%3E%2Ftmp%2Ftest.txt%3A6%3A3%22%5D%5D

opens /tmp/test.txt with the cursor at line 6, column 3.

The new entry includes a small shell snippet for generating such links from a CLI (e.g. an code <file> --line N style wrapper that emits a browser link), which is the use case that keeps coming up in #1964.

@Grynn
Grynn requested a review from a team as a code owner July 28, 2026 16:25

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool thank you!

@code-asher
code-asher merged commit 924bfac into coder:main Jul 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants