Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Console Console
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 66
    • Issues 66
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOME
  • ConsoleConsole
  • Merge requests
  • !97

Open new tabs in the current folder

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Sergio Costas requested to merge sergio-costas/console:open_new_tabs_in_current_folder into main Jun 28, 2022
  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 1

Currently, each new tab is opened in the $HOME folder (or in the folder where the first instance of kgx was launched).

Although all the piping is already in place to allow to open each new tab in the same folder than the current one, the problem is that VTE neither returns the current folder's URI, nor emits a signal when the user changed the current folder.

This is because VTE requires some help from the shell in order to know in which folder it is at each moment. The shell must emit the string each time the current folder changes or is set.

\ESC]6;CURRENT_FOLDER_URI\BELL

This patch achieves this by setting the PROMPT_COMMAND to:

echo -ne "\033]6;file://${PWD}\007"

Notice that VTE expects an URI, not a path; that's why the string includes a "file://" before $PWD.

The \ESC]7;XXXXX\BELL command changes the current folder URI, and the \ESC]6;XXXXX\BELL command changes the current file. Since Console uses both indistinctly, and gives priority to the current file URI, the command used sets the current file, but probably it would be a better idea to remove all the "current file" part and rely only in the "current path" part.

This patch has the problem of being incompatible with the user setting PROMPT_COMMAND in its .bashrc file.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: open_new_tabs_in_current_folder