warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.31k stars 371 forks source link

shell function doesn't be automatically completed by tab #4798

Open ruukina opened 6 months ago

ruukina commented 6 months ago

Discord username (optional)

No response

Describe the bug

Created shell functions or command aliases in Warp envrionment cannot be completed by tab. Issue is on both of Mac OS and Linux version.

To reproduce

  1. Run Warp
  2. Create a shell function, for example,
    ~
    $ function test_fn
    function> ls
    ~
  3. Type test and push the TAB
  4. Can confirm there's no test_fn in candidate list

Expected behavior

Shell function or aliased command should be appear as candidate when doing TAB auto completioin Note that

Screenshots

No response

Operating system

MacOS

Operating system and version

14.4.1

Shell Version

No response

Current Warp version

v0.2024.04.16.08.02.stable_00

Regression

No, this bug or issue has existed throughout my experience using Warp

Recent working Warp date

No response

Additional context

No response

Does this block you from using Warp daily?

Yes, this issue prevents me from using Warp daily.

Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)

Yes, this I confirmed this only happens in Warp, not other terminals.

Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e

None

dannyneira commented 6 months ago

Hi @ruukina since Warp should load the completion for the function if you put in to your rc file (i.e.~/.zshrc) and load a new session (window/tab/pane).

CleanShot 2024-04-26 at 17 13 00

ruukina commented 6 months ago

@dannyneira , thank you for your comment. But unfortunately, it cannot be a solution. Not all shell functions or aliases are "static".

For example, Google provides "lunch" as a shell function when building AOSP. But even if you did "source build/envsetup.sh", which defines the "lunch", on Warp, you cannot find "lunch" from Warp's auto completion candidate list. Not only "lunch", evnsetup.sh provides number of functions for development convenience.

dannyneira commented 4 months ago

@ruukina thanks for your patience. there is no fix for dynamically updating shell functions to be loaded on the fly in Warp. Your best bet is to fallback to shell completions by running your preferred shell zsh,bash,fish`, in a subshell.

dannyneira commented 4 months ago

We are tracking shell completion request here: https://github.com/warpdotdev/Warp/discussions/434