kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.11k stars 972 forks source link

Zshrc does not get sourced when launching with cwd #4356

Closed cd-a closed 2 years ago

cd-a commented 2 years ago

Describe the bug When I use the launch command on a mapping, it creates a new split, and as usual my ~/.zshrc gets parsed on start. However, when changing the current working directory in the launch command, this does not happen.

I'm running the current master.

To Reproduce Steps to reproduce the behavior:

  1. Add the following to the end of your ~/.zshrc: echo "hi from zshrc"
  2. add the following mapping map ctrl+y launch --cwd=~/dev (or another directory that you have)
  3. add the following mapping map ctrl+u launch
  4. launch without cwd: Screenshot 2021-12-14 at 10 38 08
  5. launch with cwd: Screenshot 2021-12-14 at 10 37 45

Environment details

kitty 0.23.1 (1f264ffec5) created by Kovid Goyal
Darwin Mac-mini.local 20.6.0 Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:42 PDT 2021; root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64
ProductName:    macOS ProductVersion:   11.6.1 BuildVersion:    20G224
Frozen: False
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/kitty/kitty
  system shell: /usr/local/bin/zsh
Loaded config files:
  /Users/cda/.config/kitty/kitty.conf
Loaded config overrides:
  --single-instance

Config options different from defaults:
active_tab_font_style        (True, False)
allow_remote_control         y
clipboard_control            ('write-clipboard', 'write-primary')
cursor_blink_interval        0.0
draw_minimal_borders         False
enabled_layouts              ['tall:bias=75;full_size=1;mirrored=true', 'stack']
font_family                  DejavuSansMono Nerd Font Mono
font_size                    13.0
hide_window_decorations      1
listen_on                    unix:/tmp/mykitty
macos_option_as_alt          3
macos_traditional_fullscreen True
mouse_hide_wait              -1.0
startup_session              /Users/cda/.config/kitty/sessions/General.conf
tab_bar_style                powerline
tab_powerline_style          slanted
url_style                    1
Changed mouse actions:
     b1 -2 ungrabbed mouse_click_url_or_select
     shift+b1 -2 ungrabbed mouse_click_url_or_select
     shift+b1 -2 grabbed mouse_click_url_or_select
     shift+ctrl+b1 repeat ungrabbed mouse_click_url
     shift+ctrl+b1 repeat grabbed mouse_click_url
Added shortcuts:
    ctrl+  next_layout
    ctrl+h kitten pass_keys.py neighboring_window left   ctrl+h
    ctrl+j kitten pass_keys.py neighboring_window bottom ctrl+j
    ctrl+k kitten pass_keys.py neighboring_window top    ctrl+k
    ctrl+l kitten pass_keys.py neighboring_window right  ctrl+l
    ctrl+y launch
    cmd+x kitten start_session.py "~/.config/kitty/sessions"
Colors:
    active_border_color          #d79921   
    active_tab_background        #fabd2f   
    active_tab_foreground        #282828   
    background                   #32302f   
    bell_border_color            #fabd2f   
    color0                       #32302f   
    color1                       #cc241d   
    color10                      #b8bb26   
    color11                      #fabd2f   
    color12                      #83a598   
    color13                      #d3869b   
    color14                      #8ec07c   
    color15                      #fbf1c7   
    color2                       #98971a   
    color3                       #d79921   
    color4                       #458588   
    color5                       #b16286   
    color6                       #689d6a   
    color7                       #a89984   
    color8                       #7c6f64   
    color9                       #fb4934   
    cursor                       #928374   
    cursor_text_color            #282828   
    foreground                   #fbf1c7   
    inactive_border_color        #32302f   
    inactive_tab_background      #ebdbb2   
    inactive_tab_foreground      #282828   
    selection_background         #ebdbb2   
    selection_foreground         #928374   
    url_color                    #fe8019   
kovidgoyal commented 2 years ago

Does not repro for me with

kitty --config=NONE -o shell=zsh -o 'map f1 launch --cwd=/tmp'

pressing f1 results ina new split in which zshrc is sourced.

cd-a commented 2 years ago

Thanks for the quick reply Kovid.

I had a long reply here but then I figured it out, it was an issue in my own config. It now works very well, thanks again for the very quick response!