posit-dev / posit-dev/positron

Gesture to set working directory to parent of current file

Open
#11,151 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: core enhancement support
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 11h
Merged PRs (30d)
206

Description

RStudio has a neat feature wherein you can right-click on a tab and set the working directory to the parent of the associated script.

Image

It's a command, too.

Image

This is pretty handy if your code uses file paths relative to the script itself, e.g.

# script.R
read.csv("./data.csv")

Positron doesn't have this gesture; the closest thing we have is a context menu on directories in the Explorer pane.

Image

Another way to do this would be to give each script its own session, which would (like notebooks and notebook sessions) use the script's parent as its default working directory.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Explorer directory context menu and the notebook/session behavior described in the issue, then determine how a script tab could expose the requested working-directory action. Done means a user can invoke a gesture or command for the active script and set the working directory to that script's parent.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
desktop, developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.