mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-20 07:51:14 -03:00
Compare commits
177 Commits
Integratio
...
fish-reena
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c7062def9 | ||
|
|
8a4a8bb6a0 | ||
|
|
e1b064f6cc | ||
|
|
68a8cd4501 | ||
|
|
5f0d83d2f2 | ||
|
|
03f54171c6 | ||
|
|
f391b4a179 | ||
|
|
8db674b6b5 | ||
|
|
f03113d048 | ||
|
|
6c48e214ca | ||
|
|
189a2e90dd | ||
|
|
9b44138917 | ||
|
|
ec7d20b347 | ||
|
|
84b52a3ed1 | ||
|
|
30b1c9570f | ||
|
|
b88622bc35 | ||
|
|
a4edb4020d | ||
|
|
e1e5dfdd62 | ||
|
|
5102c8b137 | ||
|
|
9ae9db7f70 | ||
|
|
d0aaa8d809 | ||
|
|
6024539c12 | ||
|
|
fb06ad4a44 | ||
|
|
598e98794c | ||
|
|
b3a295959d | ||
|
|
50dfd962ec | ||
|
|
65332eaacc | ||
|
|
a00e6f8696 | ||
|
|
6415dfbd35 | ||
|
|
8c387c58de | ||
|
|
da411f6fa7 | ||
|
|
8fe402e9f7 | ||
|
|
c41fc52077 | ||
|
|
f7d730390c | ||
|
|
8fc30d5243 | ||
|
|
93c4d63295 | ||
|
|
7a07c08860 | ||
|
|
1cf110d083 | ||
|
|
fef358fc74 | ||
|
|
b5feb79a7c | ||
|
|
4d52245617 | ||
|
|
ff308b36af | ||
|
|
fa8cf8a1a5 | ||
|
|
5ade4a037e | ||
|
|
861002917a | ||
|
|
eddb26d490 | ||
|
|
b7fe3190bb | ||
|
|
b6ddb56cc7 | ||
|
|
8dd59081d7 | ||
|
|
3ae17ea100 | ||
|
|
10c34c5353 | ||
|
|
e3ebda3647 | ||
|
|
092e7fa274 | ||
|
|
dd47c2baa2 | ||
|
|
15065255e9 | ||
|
|
594f1df39c | ||
|
|
724416125e | ||
|
|
3afafe6398 | ||
|
|
af7446a055 | ||
|
|
7be101e8c9 | ||
|
|
5f18b173dd | ||
|
|
3fec9c8145 | ||
|
|
bdca70bfb0 | ||
|
|
5e28f068ec | ||
|
|
a0b22077a5 | ||
|
|
1d36b04ea6 | ||
|
|
6829c9d678 | ||
|
|
e1f6ab8916 | ||
|
|
778baaecb5 | ||
|
|
a189f79590 | ||
|
|
6395644e8c | ||
|
|
a958f23f63 | ||
|
|
ec8756d7a3 | ||
|
|
b7fabb11ac | ||
|
|
74ba4e9a98 | ||
|
|
b1e8fdfaa2 | ||
|
|
9eb439c01d | ||
|
|
fbfd29d6d2 | ||
|
|
f158a3ae3e | ||
|
|
7d59b4f4e2 | ||
|
|
e99eca47c3 | ||
|
|
d683769e1f | ||
|
|
9ea328e43a | ||
|
|
f6d93f2fdb | ||
|
|
b644fdbb04 | ||
|
|
7647d68b68 | ||
|
|
d167ab9376 | ||
|
|
e68bd2f980 | ||
|
|
b5c17d4743 | ||
|
|
66ca7ac6d0 | ||
|
|
e97a616ffa | ||
|
|
061517cd14 | ||
|
|
6accc475c9 | ||
|
|
c2e2fd6432 | ||
|
|
83af5c91bd | ||
|
|
e9f5982147 | ||
|
|
50819666b1 | ||
|
|
6ad13e35c0 | ||
|
|
39e2f1138b | ||
|
|
cd37c71e29 | ||
|
|
c1f3d93b3b | ||
|
|
0aa05032c4 | ||
|
|
174130fe2f | ||
|
|
d06f7f01d2 | ||
|
|
a04ddd9b17 | ||
|
|
12929fed74 | ||
|
|
87bf580f68 | ||
|
|
66bab5e767 | ||
|
|
4b12fb2887 | ||
|
|
623c14aed0 | ||
|
|
7d83dc4758 | ||
|
|
493d0bca95 | ||
|
|
983501ff8c | ||
|
|
20da9a2b51 | ||
|
|
7aec6c55f9 | ||
|
|
532f30e031 | ||
|
|
1d7ab57e3a | ||
|
|
8adc598e90 | ||
|
|
c884c08257 | ||
|
|
66dc734c11 | ||
|
|
77fee9acb9 | ||
|
|
6b66c2bc1d | ||
|
|
81b9f50dc2 | ||
|
|
fcd246064b | ||
|
|
86a0a348ee | ||
|
|
ed36e852d2 | ||
|
|
da5d93c1e2 | ||
|
|
7b59ae0d82 | ||
|
|
97acc12d62 | ||
|
|
db6a7d26cd | ||
|
|
6be03d7cc4 | ||
|
|
617a6edb13 | ||
|
|
31c85723e8 | ||
|
|
d22c905d9f | ||
|
|
216dc2d473 | ||
|
|
918e7abe6b | ||
|
|
c145ee6df3 | ||
|
|
62543b36a4 | ||
|
|
751aad5302 | ||
|
|
efabab492a | ||
|
|
c7cdbe60cd | ||
|
|
412149a5de | ||
|
|
abd23d2a1b | ||
|
|
b774c54a6f | ||
|
|
e4b797405b | ||
|
|
81a89a5dec | ||
|
|
0da12a6b55 | ||
|
|
86ec8994e6 | ||
|
|
caf426ddb2 | ||
|
|
508ae410a6 | ||
|
|
993b977c9b | ||
|
|
a7f0138fc7 | ||
|
|
ab3c932903 | ||
|
|
ae0fdadcff | ||
|
|
e3974989d8 | ||
|
|
080b1e0e4f | ||
|
|
a5db91dd85 | ||
|
|
b62f54631b | ||
|
|
d835c5252a | ||
|
|
a53db72564 | ||
|
|
61b0368dac | ||
|
|
568b4a22f9 | ||
|
|
8abba8a089 | ||
|
|
b3b789cd68 | ||
|
|
425a166111 | ||
|
|
1dcc290e29 | ||
|
|
863204dbfa | ||
|
|
4b21e7c9c7 | ||
|
|
df5230ff4a | ||
|
|
7cd0943056 | ||
|
|
6f0532460a | ||
|
|
29a35a7951 | ||
|
|
dd0d45f88f | ||
|
|
0ff0de7efe | ||
|
|
092ef99551 | ||
|
|
97ae05b69d | ||
|
|
3d8eca178e |
@@ -1,7 +1,6 @@
|
||||
image: alpine/edge
|
||||
packages:
|
||||
- cargo
|
||||
- clang17-libclang
|
||||
- cmake
|
||||
- ninja
|
||||
- pcre2-dev
|
||||
@@ -24,4 +23,4 @@ tasks:
|
||||
ninja
|
||||
- test: |
|
||||
cd fish-shell/build
|
||||
ninja test
|
||||
ninja fish_run_tests
|
||||
|
||||
@@ -20,4 +20,4 @@ tasks:
|
||||
ninja
|
||||
- test: |
|
||||
cd fish/build
|
||||
ninja test
|
||||
ninja fish_run_tests
|
||||
|
||||
@@ -5,7 +5,6 @@ packages:
|
||||
- gettext
|
||||
- gmake
|
||||
- llvm
|
||||
- terminfo-db
|
||||
- ninja
|
||||
- pcre2
|
||||
- py311-pexpect
|
||||
@@ -27,4 +26,4 @@ tasks:
|
||||
ninja
|
||||
- test: |
|
||||
cd fish-shell/build
|
||||
ninja test
|
||||
ninja fish_run_tests
|
||||
|
||||
29
.builds/openbsd.yml
Normal file
29
.builds/openbsd.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
image: openbsd/latest
|
||||
packages:
|
||||
- cmake
|
||||
- gcc
|
||||
- gettext
|
||||
- gmake
|
||||
- llvm
|
||||
- ninja
|
||||
- pcre2
|
||||
- py311-pexpect
|
||||
- python
|
||||
- rust
|
||||
- tmux
|
||||
sources:
|
||||
- https://github.com/fish-shell/fish-shell
|
||||
tasks:
|
||||
- build: |
|
||||
cd fish-shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja .. \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_INSTALL_DATADIR=share \
|
||||
-DCMAKE_INSTALL_DOCDIR=share/doc/fish \
|
||||
-DCMAKE_INSTALL_SYSCONFDIR=/etc
|
||||
ninja
|
||||
- test: |
|
||||
cd fish-shell/build
|
||||
ninja fish_run_tests
|
||||
21
.cirrus.yml
21
.cirrus.yml
@@ -1,3 +1,5 @@
|
||||
skip: $CIRRUS_REPO_OWNER == 'fish-shell' && $CIRRUS_BRANCH == 'master'
|
||||
|
||||
env:
|
||||
CIRRUS_CLONE_DEPTH: 100
|
||||
CI: 1
|
||||
@@ -6,20 +8,12 @@ linux_task:
|
||||
matrix:
|
||||
- name: alpine
|
||||
container: &step
|
||||
image: ghcr.io/krobelus/fish-ci/alpine:latest
|
||||
image: ghcr.io/fish-shell/fish-ci/alpine:latest
|
||||
memory: 4GB
|
||||
- name: jammy
|
||||
container:
|
||||
<<: *step
|
||||
image: ghcr.io/krobelus/fish-ci/jammy:latest
|
||||
# - name: jammy-asan
|
||||
# container:
|
||||
# <<: *step
|
||||
# image: ghcr.io/krobelus/fish-ci/jammy-asan:latest
|
||||
# - name: focal-32bit
|
||||
# container:
|
||||
# <<: *step
|
||||
# image: ghcr.io/krobelus/fish-ci/focal-32bit:latest
|
||||
image: ghcr.io/fish-shell/fish-ci/jammy:latest
|
||||
tests_script:
|
||||
# cirrus at times gives us 32 procs and 2 GB of RAM
|
||||
# Unrestriced parallelism results in OOM
|
||||
@@ -36,9 +30,6 @@ linux_arm_task:
|
||||
- name: focal-arm64
|
||||
arm_container:
|
||||
image: ghcr.io/fish-shell/fish-ci/focal-arm64
|
||||
- name: jammy-armv7-32bit
|
||||
arm_container:
|
||||
image: ghcr.io/fish-shell/fish-ci/jammy-armv7-32bit
|
||||
tests_script:
|
||||
# cirrus at times gives us 32 procs and 2 GB of RAM
|
||||
# Unrestriced parallelism results in OOM
|
||||
@@ -47,10 +38,8 @@ linux_arm_task:
|
||||
- mkdir build && cd build
|
||||
- FISH_TEST_MAX_CONCURRENCY=6 cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
|
||||
- ninja -j 6 fish
|
||||
- file ./fish
|
||||
- ninja fish_run_tests
|
||||
# CI task disabled during RIIR transition
|
||||
only_if: false && $CIRRUS_REPO_OWNER == 'fish-shell'
|
||||
only_if: $CIRRUS_REPO_OWNER == 'fish-shell'
|
||||
|
||||
freebsd_task:
|
||||
matrix:
|
||||
|
||||
43
.github/actions/install-dependencies/action.yml
vendored
Normal file
43
.github/actions/install-dependencies/action.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Install dependencies for system tests
|
||||
|
||||
inputs:
|
||||
include_sphinx:
|
||||
description: Whether to install Sphinx
|
||||
required: true
|
||||
default: false
|
||||
include_pcre:
|
||||
description: Whether to install the PCRE library
|
||||
required: false
|
||||
default: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- shell: bash
|
||||
env:
|
||||
include_sphinx: ${{ inputs.include_sphinx }}
|
||||
include_pcre: ${{ inputs.include_pcre }}
|
||||
run: |
|
||||
set -x
|
||||
: "optional dependencies"
|
||||
sudo apt install \
|
||||
gettext \
|
||||
$(if $include_pcre; then echo libpcre2-dev; fi) \
|
||||
$(if $include_sphinx; then echo python3-sphinx; fi) \
|
||||
;
|
||||
: "system test dependencies"
|
||||
sudo apt install \
|
||||
diffutils $(: "for diff") \
|
||||
git \
|
||||
gettext \
|
||||
less \
|
||||
$(if ${{ inputs.include_pcre }}; then echo libpcre2-dev; fi) \
|
||||
python3-pexpect \
|
||||
tmux \
|
||||
wget \
|
||||
;
|
||||
- uses: ./.github/actions/install-sphinx-markdown-builder
|
||||
if: ${{ inputs.include_sphinx == 'true' }}
|
||||
41
.github/actions/rust-toolchain/action.yml
vendored
Normal file
41
.github/actions/rust-toolchain/action.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Rust Toolchain
|
||||
|
||||
inputs:
|
||||
toolchain_channel:
|
||||
description: Either "stable" or "msrv"
|
||||
required: true
|
||||
targets:
|
||||
description: Comma-separated list of target triples to install for this toolchain
|
||||
required: false
|
||||
components:
|
||||
description: Comma-separated list of components to be additionally installed
|
||||
required: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Set toolchain
|
||||
env:
|
||||
toolchain_channel: ${{ inputs.toolchain_channel }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -x
|
||||
toolchain=$(
|
||||
case "$toolchain_channel" in
|
||||
(stable) echo 1.90 ;;
|
||||
(msrv) echo 1.70 ;;
|
||||
(*)
|
||||
printf >&2 "error: unsupported toolchain channel %s" "$toolchain_channel"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
)
|
||||
printf 'TOOLCHAIN=%s\n' "$toolchain" >>"$GITHUB_ENV"
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ env.TOOLCHAIN }}
|
||||
targets: ${{ inputs.targets }}
|
||||
components: ${{ inputs.components }}
|
||||
@@ -14,7 +14,8 @@ permissions:
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
- uses: ./.github/actions/rust-toolchain
|
||||
with:
|
||||
toolchain_channel: "msrv"
|
||||
targets: ${{ inputs.targets }}
|
||||
components: ${{ inputs.components}}
|
||||
components: ${{ inputs.components }}
|
||||
|
||||
@@ -14,7 +14,8 @@ permissions:
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: dtolnay/rust-toolchain@1.90
|
||||
- uses: ./.github/actions/rust-toolchain
|
||||
with:
|
||||
toolchain_channel: "stable"
|
||||
targets: ${{ inputs.targets }}
|
||||
components: ${{ inputs.components }}
|
||||
|
||||
126
.github/workflows/build_docker_images.yml
vendored
Normal file
126
.github/workflows/build_docker_images.yml
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
name: Build Docker test images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: docker-builds
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
NAMESPACE: fish-ci
|
||||
ONLY_FOR_REPO_OWNER: fish-shell
|
||||
|
||||
jobs:
|
||||
check-docker-changes:
|
||||
if: github.repository_owner == env.ONLY_FOR_REPO_OWNER
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
docker-changed: ${{ steps.changes.outputs.docker }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
with:
|
||||
filters: |
|
||||
docker:
|
||||
- 'docker/**'
|
||||
|
||||
docker-build:
|
||||
needs: check-docker-changes
|
||||
if: github.repository_owner == env.ONLY_FOR_REPO_OWNER && needs.check-docker-changes.outputs.docker-changed == 'true'
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
attestations: write
|
||||
id-token: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
target: alpine
|
||||
- os: ubuntu-latest
|
||||
target: centos9
|
||||
- os: ubuntu-latest
|
||||
target: fedora
|
||||
- os: ubuntu-latest
|
||||
target: focal-32bit
|
||||
- os: ubuntu-24.04-arm
|
||||
target: focal-arm64
|
||||
- os: ubuntu-latest
|
||||
target: focal
|
||||
- os: ubuntu-24.04-arm
|
||||
target: jammy-armv7-32bit
|
||||
- os: ubuntu-latest
|
||||
target: jammy-asan
|
||||
- os: ubuntu-latest
|
||||
target: jammy-tsan
|
||||
- os: ubuntu-latest
|
||||
target: jammy
|
||||
- os: ubuntu-latest
|
||||
target: noble
|
||||
- os: ubuntu-latest
|
||||
target: opensuse-tumbleweed
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v5
|
||||
-
|
||||
name: Login to Container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
-
|
||||
name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.NAMESPACE }}/${{ matrix.target }}
|
||||
flavor: |
|
||||
latest=true
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: docker/context
|
||||
push: true
|
||||
file: docker/${{ matrix.target }}.Dockerfile
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
trigger-cirrus:
|
||||
needs: [check-docker-changes, docker-build]
|
||||
if: always() && github.repository_owner == env.ONLY_FOR_REPO_OWNER
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger Cirrus CI
|
||||
env:
|
||||
CIRRUS_TOKEN: ${{ secrets.CIRRUS_TOKEN }}
|
||||
run: |
|
||||
set -x
|
||||
# N.B. push-triggered workflows are usually from master.
|
||||
branch=${{ github.ref_name }}
|
||||
repository_id=${{ github.repository_id }}
|
||||
curl -X POST \
|
||||
-H "Authorization: Bearer $CIRRUS_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"query": "mutation {
|
||||
createBuild(input: {
|
||||
repositoryId: \"$repository_id\",
|
||||
branch: \"$branch\"
|
||||
})
|
||||
{ build { id } }
|
||||
}"
|
||||
}' \
|
||||
https://api.cirrus-ci.com/graphql
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Rust checks
|
||||
name: Lint
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
@@ -6,25 +6,36 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
rustfmt:
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
- name: cargo fmt
|
||||
run: cargo fmt --check
|
||||
- name: install dependencies
|
||||
run: pip install ruff
|
||||
- name: build fish
|
||||
run: cargo build
|
||||
- name: check format
|
||||
run: PATH="target/debug:$PATH" build_tools/style.fish --all --check
|
||||
|
||||
clippy-stable:
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
features: ["", "--no-default-features"]
|
||||
include:
|
||||
- rust_version: "stable"
|
||||
features: ""
|
||||
- rust_version: "stable"
|
||||
features: "--no-default-features"
|
||||
- rust_version: "msrv"
|
||||
features: ""
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/rust-toolchain@stable
|
||||
- uses: ./.github/actions/rust-toolchain
|
||||
with:
|
||||
toolchain_channel: ${{ matrix.rust_version }}
|
||||
components: clippy
|
||||
- name: Install deps
|
||||
run: |
|
||||
@@ -32,19 +43,6 @@ jobs:
|
||||
- name: cargo clippy
|
||||
run: cargo clippy --workspace --all-targets ${{ matrix.features }} -- --deny=warnings
|
||||
|
||||
clippy-msrv:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
with:
|
||||
components: clippy
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt install gettext
|
||||
- name: cargo clippy
|
||||
run: cargo clippy --workspace --all-targets -- --deny=warnings
|
||||
|
||||
rustdoc:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
1
.github/workflows/lockthreads.yml
vendored
1
.github/workflows/lockthreads.yml
vendored
@@ -12,6 +12,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
lock:
|
||||
if: github.repository_owner == 'fish-shell'
|
||||
permissions:
|
||||
issues: write # for dessant/lock-threads to lock issues
|
||||
pull-requests: write # for dessant/lock-threads to lock PRs
|
||||
|
||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -80,7 +80,7 @@ jobs:
|
||||
with:
|
||||
targets: x86_64-unknown-linux-musl,aarch64-unknown-linux-musl
|
||||
- name: Install dependencies
|
||||
run: sudo apt install crossbuild-essential-arm64 musl-tools python3-sphinx
|
||||
run: sudo apt install crossbuild-essential-arm64 gettext musl-tools python3-sphinx
|
||||
- name: Build statically-linked executables
|
||||
run: |
|
||||
set -x
|
||||
@@ -150,6 +150,8 @@ jobs:
|
||||
uses: ./.github/actions/rust-toolchain@stable
|
||||
with:
|
||||
targets: aarch64-apple-darwin
|
||||
- name: Install dependencies
|
||||
run: brew install gettext
|
||||
- name: Build and codesign
|
||||
run: |
|
||||
die() { echo >&2 "$*"; exit 1; }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: make fish_run_tests
|
||||
name: Test
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
@@ -11,18 +11,17 @@ permissions:
|
||||
|
||||
jobs:
|
||||
ubuntu:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
- name: Install deps
|
||||
uses: ./.github/actions/install-dependencies
|
||||
with:
|
||||
include_sphinx: true
|
||||
- name: Generate a locale that uses a comma as decimal separator.
|
||||
run: |
|
||||
sudo apt install gettext libpcre2-dev python3-pexpect python3-sphinx tmux
|
||||
# Generate a locale that uses a comma as decimal separator.
|
||||
sudo locale-gen fr_FR.UTF-8
|
||||
- uses: ./.github/actions/install-sphinx-markdown-builder
|
||||
- name: cmake
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
@@ -43,18 +42,20 @@ jobs:
|
||||
git --no-pager diff --exit-code || { echo 'There are uncommitted changes after regenerating the gettext PO files. Make sure to update them via `build_tools/update_translations.fish` after changing source files.'; exit 1; }
|
||||
|
||||
ubuntu-32bit-static-pcre2:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
with:
|
||||
targets: "i586-unknown-linux-gnu" # rust-toolchain wants this comma-separated
|
||||
targets: "i586-unknown-linux-gnu"
|
||||
- name: Install deps
|
||||
uses: ./.github/actions/install-dependencies
|
||||
with:
|
||||
include_pcre: false
|
||||
include_sphinx: false
|
||||
- name: Install g++-multilib
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install gettext python3-pexpect g++-multilib tmux
|
||||
sudo apt install g++-multilib
|
||||
- name: cmake
|
||||
env:
|
||||
CFLAGS: "-m32"
|
||||
@@ -69,7 +70,6 @@ jobs:
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
ubuntu-asan:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
# Rust has two different memory sanitizers of interest; they can't be used at the same time:
|
||||
@@ -79,7 +79,6 @@ jobs:
|
||||
#
|
||||
RUSTFLAGS: "-Zsanitizer=address"
|
||||
# RUSTFLAGS: "-Zsanitizer=memory -Zsanitizer-memory-track-origins"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# All -Z options require running nightly
|
||||
@@ -89,8 +88,11 @@ jobs:
|
||||
# this is comma-separated
|
||||
components: rust-src
|
||||
- name: Install deps
|
||||
uses: ./.github/actions/install-dependencies
|
||||
with:
|
||||
include_sphinx: false
|
||||
- name: Install llvm
|
||||
run: |
|
||||
sudo apt install gettext libpcre2-dev python3-pexpect tmux
|
||||
sudo apt install llvm # for llvm-symbolizer
|
||||
- name: cmake
|
||||
env:
|
||||
@@ -119,38 +121,8 @@ jobs:
|
||||
export LSAN_OPTIONS="$LSAN_OPTIONS:suppressions=$PWD/build_tools/lsan_suppressions.txt"
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
# Our clang++ tsan builds are not recognizing safe rust patterns (such as the fact that Drop
|
||||
# cannot be called while a thread is using the object in question). Rust has its own way of
|
||||
# running TSAN, but for the duration of the port from C++ to Rust, we'll keep this disabled.
|
||||
|
||||
# ubuntu-threadsan:
|
||||
#
|
||||
# runs-on: ubuntu-latest
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
# - name: Install deps
|
||||
# run: |
|
||||
# sudo apt install gettext libpcre2-dev python3-pexpect tmux
|
||||
# - name: cmake
|
||||
# env:
|
||||
# FISH_CI_SAN: 1
|
||||
# CC: clang
|
||||
# run: |
|
||||
# mkdir build && cd build
|
||||
# cmake ..
|
||||
# - name: make
|
||||
# run: |
|
||||
# make
|
||||
# - name: make fish_run_tests
|
||||
# run: |
|
||||
# make -C build fish_run_tests
|
||||
|
||||
macos:
|
||||
|
||||
runs-on: macos-latest
|
||||
|
||||
env:
|
||||
# macOS runners keep having issues loading Cargo.toml dependencies from git (GitHub) instead
|
||||
# of crates.io, so give this a try. It's also sometimes significantly faster on all platforms.
|
||||
@@ -163,7 +135,7 @@ jobs:
|
||||
# --break-system-packages because homebrew has now declared itself "externally managed".
|
||||
# this is CI so we don't actually care.
|
||||
sudo pip3 install --break-system-packages pexpect
|
||||
brew install tmux
|
||||
brew install gettext tmux
|
||||
- name: cmake
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
@@ -174,3 +146,28 @@ jobs:
|
||||
- name: make fish_run_tests
|
||||
run: |
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: msys2 {0}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
update: true
|
||||
msystem: MSYS
|
||||
- name: Install deps
|
||||
# Not using setup-msys2 `install` option to make it easier to copy/paste
|
||||
run: |
|
||||
pacman --noconfirm -S --needed git rust
|
||||
- name: cargo build
|
||||
run: |
|
||||
cargo build
|
||||
- name: smoketest
|
||||
# We can't use `cargo test` yet, there are just too many failures
|
||||
# so this is just a quick check to make sure that fish can swim
|
||||
run: |
|
||||
set -x
|
||||
[ "$(target/debug/fish.exe -c 'echo (math 1 + 1)')" = 2 ]
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -105,3 +105,6 @@ target/
|
||||
|
||||
# JetBrains editors.
|
||||
.idea/
|
||||
|
||||
# AI slop
|
||||
.claude/
|
||||
|
||||
@@ -1,3 +1,51 @@
|
||||
fish ?.?.? (released ???)
|
||||
=========================
|
||||
|
||||
fish 4.1.3 (released ???)
|
||||
=========================
|
||||
|
||||
This release fixes the following regressions identified in 4.1.0:
|
||||
|
||||
- Crash on invalid :doc:`function <cmds/function>` command (:issue:`11912`).
|
||||
|
||||
as well as the following regressions identified in 4.0.0:
|
||||
|
||||
- Crash when passing negative PIDs to :doc:`wait <cmds/wait>` (:issue:`11929`).
|
||||
|
||||
fish 4.1.2 (released October 7, 2025)
|
||||
=====================================
|
||||
|
||||
This release fixes the following regressions identified in 4.1.0:
|
||||
|
||||
- Fixed spurious error output when completing remote file paths for ``scp`` (:issue:`11860`).
|
||||
- Fixed the :kbd:`alt-l` binding not formatting ``ls`` output correctly (one entry per line, no colors) (:issue:`11888`).
|
||||
- Fixed an issue where focus events (currently only enabled in ``tmux``) would cause multiline prompts to be redrawn in the wrong line (:issue:`11870`).
|
||||
- Stopped printing output that would cause a glitch on old versions of Midnight Commander (:issue:`11869`).
|
||||
- Added a fix for some configurations of Zellij where :kbd:`escape` key processing was delayed (:issue:`11868`).
|
||||
- Fixed a case where the :doc:`web-based configuration tool <cmds/fish_config>` would generate invalid configuration (:issue:`11861`).
|
||||
- Fixed a case where pasting into ``fish -c read`` would fail with a noisy error (:issue:`11836`).
|
||||
- Fixed a case where upgrading fish would break old versions of fish that were still running.
|
||||
|
||||
In general, fish still needs to be restarted after it is upgraded,
|
||||
except for `standalone builds <https://github.com/fish-shell/fish-shell/?tab=readme-ov-file#building-fish-with-embedded-data-experimental>`__.
|
||||
|
||||
fish 4.1.1 (released September 30, 2025)
|
||||
========================================
|
||||
|
||||
This release fixes the following regressions identified in 4.1.0:
|
||||
|
||||
- Many of our new Chinese translations were more confusing than helpful; they have been fixed or removed (:issue:`11833`).
|
||||
|
||||
Note that you can work around this type of issue by configuring fish's :doc:`message localization <cmds/_>`:
|
||||
if your environment contains something like ``LANG=zh_CN.UTF-8``,
|
||||
you can use ``set -g LC_MESSAGES en`` to use English messages inside fish.
|
||||
This will not affect fish's child processes unless ``LC_MESSAGES`` was already exported.
|
||||
|
||||
- Some :doc:`fish_config <cmds/fish_config>` subcommands for showing prompts and themes had been broken in standalone Linux builds (those using the ``embed-data`` cargo feature), which has been fixed (:issue:`11832`).
|
||||
- On Windows Terminal, we observed an issue where fish would fail to read the terminal's response to our new startup queries, causing noticeable lags and a misleading error message. A workaround has been added (:issue:`11841`).
|
||||
- A WezTerm `issue breaking shifted key input <https://github.com/wezterm/wezterm/issues/6087>`__ has resurfaced on some versions of WezTerm; our workaround has been extended to cover all versions for now (:issue:`11204`).
|
||||
- Fixed a crash in :doc:`the web-based configuration tool <cmds/fish_config>` when using the new underline styles (:issue:`11840`).
|
||||
|
||||
fish 4.1.0 (released September 27, 2025)
|
||||
========================================
|
||||
|
||||
@@ -30,7 +78,7 @@ Deprecations and removed features
|
||||
- The ``--install`` option when fish is built as self-installing is removed, see :ref:`below <changelog-4.1-embedded>`.
|
||||
- ``set_color ff0000`` now outputs 24-bit RGB true-color even if :envvar:`COLORTERM` is unset.
|
||||
One can override this by setting :envvar:`fish_term24bit` to 0 (:issue:`11372`).
|
||||
- fish now requires the terminal to respond to queries for the :ref:`primary device attribute <term-compat-primary-da>`.
|
||||
- fish now requires the terminal to respond to queries for the :ref:`Primary Device Attribute <term-compat-primary-da>`.
|
||||
For now, this can be reversed via a :ref:`feature flag <featureflags>`,
|
||||
by running (once) ``set -Ua fish_features no-query-term`` and restarting fish.
|
||||
- Users of GNU screen may experience :ref:`minor glitches <term-compat-dcs-gnu-screen>` when starting fish.
|
||||
@@ -83,9 +131,6 @@ Improved terminal support
|
||||
- Support for double, curly, dotted and dashed underlines, for use in ``fish_color_*`` variables and the :doc:`set_color builtin <cmds/set_color>` (:issue:`10957`).
|
||||
- Underlines can now be colored independent of text (:issue:`7619`).
|
||||
- New documentation page :doc:`Terminal Compatibility <terminal-compatibility>` (also accessible via ``man fish-terminal-compatibility``) lists the terminal control sequences used by fish.
|
||||
- fish now requires the terminal to respond to queries for the :ref:`primary device attribute <term-compat-primary-da>`.
|
||||
For now, this can be reversed via a :ref:`feature flag <featureflags>`,
|
||||
by running (once) ``set -Ua fish_features no-query-term``.
|
||||
|
||||
Other improvements
|
||||
------------------
|
||||
|
||||
@@ -110,7 +110,7 @@ before committing your change. That will run our autoformatters:
|
||||
|
||||
- ``rustfmt`` for Rust
|
||||
- ``fish_indent`` (shipped with fish) for fish script
|
||||
- ``black`` for python
|
||||
- ``ruff format`` for python
|
||||
|
||||
If you’ve already committed your changes that’s okay since it will then
|
||||
check the files in the most recent commit. This can be useful after
|
||||
@@ -343,7 +343,7 @@ command-line and graphical user interface programs. For simple use, you can use
|
||||
|
||||
Open up the PO file, for example ``po/sv.po``, and you'll see something like::
|
||||
|
||||
msgid "%ls: No suitable job\n"
|
||||
msgid "%s: No suitable job\n"
|
||||
msgstr ""
|
||||
|
||||
The ``msgid`` here is the "name" of the string to translate, typically the English string to translate.
|
||||
@@ -351,10 +351,10 @@ The second line (``msgstr``) is where your translation goes.
|
||||
|
||||
For example::
|
||||
|
||||
msgid "%ls: No suitable job\n"
|
||||
msgstr "%ls: Inget passande jobb\n"
|
||||
msgid "%s: No suitable job\n"
|
||||
msgstr "%s: Inget passande jobb\n"
|
||||
|
||||
Any ``%s`` / ``%ls`` or ``%d`` are placeholders that fish will use for formatting at runtime. It is important that they match - the translated string should have the same placeholders in the same order.
|
||||
Any ``%s`` or ``%d`` are placeholders that fish will use for formatting at runtime. It is important that they match - the translated string should have the same placeholders in the same order.
|
||||
|
||||
Also any escaped characters, like that ``\n`` newline at the end, should be kept so the translation has the same behavior.
|
||||
|
||||
@@ -381,7 +381,7 @@ macros:
|
||||
|
||||
::
|
||||
|
||||
streams.out.append(wgettext_fmt!("%ls: There are no jobs\n", argv[0]));
|
||||
streams.out.append(wgettext_fmt!("%s: There are no jobs\n", argv[0]));
|
||||
|
||||
All messages in fish script must be enclosed in single or double quote
|
||||
characters for our message extraction script to find them.
|
||||
|
||||
30
Cargo.lock
generated
30
Cargo.lock
generated
@@ -42,9 +42,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
version = "1.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9"
|
||||
|
||||
[[package]]
|
||||
name = "cfg_aliases"
|
||||
@@ -105,10 +105,11 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
||||
|
||||
[[package]]
|
||||
name = "fish"
|
||||
version = "4.1.0"
|
||||
version = "4.1.0-snapshot"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"errno",
|
||||
"fish-build-helper",
|
||||
"fish-build-man-pages",
|
||||
@@ -118,6 +119,7 @@ dependencies = [
|
||||
"fish-printf",
|
||||
"libc",
|
||||
"lru",
|
||||
"macro_rules_attribute",
|
||||
"nix",
|
||||
"num-traits",
|
||||
"once_cell",
|
||||
@@ -254,6 +256,22 @@ dependencies = [
|
||||
"hashbrown",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "macro_rules_attribute"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "65049d7923698040cd0b1ddcced9b0eb14dd22c5f86ae59c3740eab64a676520"
|
||||
dependencies = [
|
||||
"macro_rules_attribute-proc_macro",
|
||||
"paste",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "macro_rules_attribute-proc_macro"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "670fdfda89751bc4a84ac13eaa63e205cf0fd22b4c9a5fbfa085b63c1f1d3a30"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.7.4"
|
||||
@@ -326,6 +344,12 @@ dependencies = [
|
||||
"windows-targets",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "paste"
|
||||
version = "1.0.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
|
||||
|
||||
[[package]]
|
||||
name = "pcre2"
|
||||
version = "0.2.9"
|
||||
|
||||
@@ -11,6 +11,7 @@ repository = "https://github.com/fish-shell/fish-shell"
|
||||
[workspace.dependencies]
|
||||
bitflags = "2.5.0"
|
||||
cc = "1.0.94"
|
||||
cfg-if = "1.0.3"
|
||||
errno = "0.3.0"
|
||||
fish-build-helper = { path = "crates/build-helper" }
|
||||
fish-build-man-pages = { path = "crates/build-man-pages" }
|
||||
@@ -64,7 +65,7 @@ debug = true
|
||||
|
||||
[package]
|
||||
name = "fish"
|
||||
version = "4.1.0"
|
||||
version = "4.1.0-snapshot"
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
default-run = "fish"
|
||||
@@ -76,6 +77,7 @@ readme = "README.rst"
|
||||
|
||||
[dependencies]
|
||||
bitflags.workspace = true
|
||||
cfg-if.workspace = true
|
||||
errno.workspace = true
|
||||
fish-build-helper.workspace = true
|
||||
fish-build-man-pages = { workspace = true, optional = true }
|
||||
@@ -84,6 +86,7 @@ fish-gettext-maps = { workspace = true, optional = true }
|
||||
fish-printf.workspace = true
|
||||
libc.workspace = true
|
||||
lru.workspace = true
|
||||
macro_rules_attribute = "0.2.2"
|
||||
nix.workspace = true
|
||||
num-traits.workspace = true
|
||||
once_cell.workspace = true
|
||||
|
||||
@@ -128,7 +128,7 @@ Compiling fish requires:
|
||||
Sphinx is also optionally required to build the documentation from a
|
||||
cloned git repository.
|
||||
|
||||
Additionally, running the full test suite requires Python 3.5+, tmux, and the pexpect package.
|
||||
Additionally, running the full test suite requires diff, git, Python 3.5+, pexpect, less, tmux and wget.
|
||||
|
||||
Building from source with CMake
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -180,7 +180,7 @@ To install fish with embedded files, just use ``cargo``, like::
|
||||
cargo install --git https://github.com/fish-shell/fish-shell --tag "$(curl -s https://api.github.com/repos/fish-shell/fish-shell/releases/latest | jq -r .tag_name)" # to build the latest release
|
||||
cargo install --git https://github.com/fish-shell/fish-shell # to build the latest development snapshot
|
||||
|
||||
This will place the binaries in ``~/.cargo/bin/``, but you can place them wherever you want.
|
||||
This will place the standalone binaries in ``~/.cargo/bin/``, but you can place them wherever you want.
|
||||
|
||||
This build won't have the HTML docs (``help`` will open the online version).
|
||||
It will try to build the man pages with sphinx-build. If that is not available and you would like to include man pages, you need to install it and retrigger the build script, e.g. by setting FISH_BUILD_DOCS=1::
|
||||
|
||||
151
build.rs
151
build.rs
@@ -1,9 +1,8 @@
|
||||
#![allow(clippy::uninlined_format_args)]
|
||||
|
||||
use fish_build_helper::{fish_build_dir, workspace_root};
|
||||
use fish_build_helper::{env_var, fish_build_dir, workspace_root};
|
||||
use rsconf::Target;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
fn canonicalize<P: AsRef<Path>>(path: P) -> PathBuf {
|
||||
@@ -17,7 +16,7 @@ fn main() {
|
||||
// language server.
|
||||
|
||||
rsconf::set_env_value(
|
||||
"FISH_BUILD_DIR",
|
||||
"FISH_RESOLVED_BUILD_DIR",
|
||||
// If set by CMake, this might include symlinks. Since we want to compare this to the
|
||||
// dir fish is executed in we need to canonicalize it.
|
||||
canonicalize(fish_build_dir()).to_str().unwrap(),
|
||||
@@ -31,9 +30,9 @@ fn main() {
|
||||
);
|
||||
|
||||
// Some build info
|
||||
rsconf::set_env_value("BUILD_TARGET_TRIPLE", &env::var("TARGET").unwrap());
|
||||
rsconf::set_env_value("BUILD_HOST_TRIPLE", &env::var("HOST").unwrap());
|
||||
rsconf::set_env_value("BUILD_PROFILE", &env::var("PROFILE").unwrap());
|
||||
rsconf::set_env_value("BUILD_TARGET_TRIPLE", &env_var("TARGET").unwrap());
|
||||
rsconf::set_env_value("BUILD_HOST_TRIPLE", &env_var("HOST").unwrap());
|
||||
rsconf::set_env_value("BUILD_PROFILE", &env_var("PROFILE").unwrap());
|
||||
|
||||
let version = &get_version(&env::current_dir().unwrap());
|
||||
// Per https://doc.rust-lang.org/cargo/reference/build-scripts.html#inputs-to-the-build-script,
|
||||
@@ -51,9 +50,6 @@ fn main() {
|
||||
#[cfg(feature = "gettext-extract")]
|
||||
rsconf::rebuild_if_env_changed("FISH_GETTEXT_EXTRACTION_FILE");
|
||||
|
||||
rsconf::rebuild_if_path_changed("src/libc.c");
|
||||
cc::Build::new().file("src/libc.c").compile("flibc.a");
|
||||
|
||||
let build = cc::Build::new();
|
||||
let mut target = Target::new_from(build).unwrap();
|
||||
// Keep verbose mode on until we've ironed out rust build script stuff
|
||||
@@ -81,53 +77,44 @@ fn detect_cfgs(target: &mut Target) {
|
||||
for (name, handler) in [
|
||||
// Ignore the first entry, it just sets up the type inference. Model new entries after the
|
||||
// second line.
|
||||
(
|
||||
"",
|
||||
&(|_: &Target| Ok(false)) as &dyn Fn(&Target) -> Result<bool, Box<dyn Error>>,
|
||||
),
|
||||
("", &(|_: &Target| false) as &dyn Fn(&Target) -> bool),
|
||||
("apple", &detect_apple),
|
||||
("bsd", &detect_bsd),
|
||||
("cygwin", &detect_cygwin),
|
||||
("small_main_stack", &has_small_stack),
|
||||
// See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3).
|
||||
("localeconv_l", &|target| {
|
||||
Ok(target.has_symbol("localeconv_l"))
|
||||
target.has_symbol("localeconv_l")
|
||||
}),
|
||||
("FISH_USE_POSIX_SPAWN", &|target| {
|
||||
Ok(target.has_header("spawn.h"))
|
||||
target.has_header("spawn.h")
|
||||
}),
|
||||
("HAVE_PIPE2", &|target| {
|
||||
Ok(target.has_symbol("pipe2"))
|
||||
target.has_symbol("pipe2")
|
||||
}),
|
||||
("HAVE_EVENTFD", &|target| {
|
||||
// FIXME: NetBSD 10 has eventfd, but the libc crate does not expose it.
|
||||
if cfg!(target_os = "netbsd") {
|
||||
Ok(false)
|
||||
false
|
||||
} else {
|
||||
Ok(target.has_header("sys/eventfd.h"))
|
||||
target.has_header("sys/eventfd.h")
|
||||
}
|
||||
}),
|
||||
("HAVE_WAITSTATUS_SIGNAL_RET", &|target| {
|
||||
Ok(target.r#if("WEXITSTATUS(0x007f) == 0x7f", &["sys/wait.h"]))
|
||||
target.r#if("WEXITSTATUS(0x007f) == 0x7f", &["sys/wait.h"])
|
||||
}),
|
||||
] {
|
||||
match handler(target) {
|
||||
Err(e) => {
|
||||
rsconf::warn!("{}: {}", name, e);
|
||||
rsconf::declare_cfg(name, false);
|
||||
},
|
||||
Ok(enabled) => rsconf::declare_cfg(name, enabled),
|
||||
}
|
||||
rsconf::declare_cfg(name, handler(target))
|
||||
}
|
||||
}
|
||||
|
||||
fn detect_apple(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
Ok(cfg!(any(target_os = "ios", target_os = "macos")))
|
||||
fn detect_apple(_: &Target) -> bool {
|
||||
cfg!(any(target_os = "ios", target_os = "macos"))
|
||||
}
|
||||
|
||||
fn detect_cygwin(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
fn detect_cygwin(_: &Target) -> bool {
|
||||
// Cygwin target is usually cross-compiled.
|
||||
Ok(std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "cygwin")
|
||||
env_var("CARGO_CFG_TARGET_OS").unwrap() == "cygwin"
|
||||
}
|
||||
|
||||
/// Detect if we're being compiled for a BSD-derived OS, allowing targeting code conditionally with
|
||||
@@ -136,13 +123,14 @@ fn detect_cygwin(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
/// Rust offers fine-grained conditional compilation per-os for the popular operating systems, but
|
||||
/// doesn't necessarily include less-popular forks nor does it group them into families more
|
||||
/// specific than "windows" vs "unix" so we can conditionally compile code for BSD systems.
|
||||
fn detect_bsd(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
fn detect_bsd(_: &Target) -> bool {
|
||||
// Instead of using `uname`, we can inspect the TARGET env variable set by Cargo. This lets us
|
||||
// support cross-compilation scenarios.
|
||||
let mut target = std::env::var("TARGET").unwrap();
|
||||
let mut target = env_var("TARGET").unwrap();
|
||||
if !target.chars().all(|c| c.is_ascii_lowercase()) {
|
||||
target = target.to_ascii_lowercase();
|
||||
}
|
||||
#[allow(clippy::let_and_return)] // for old clippy
|
||||
let is_bsd = target.ends_with("bsd") || target.ends_with("dragonfly");
|
||||
#[cfg(any(
|
||||
target_os = "dragonfly",
|
||||
@@ -151,7 +139,7 @@ fn detect_bsd(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
target_os = "openbsd",
|
||||
))]
|
||||
assert!(is_bsd, "Target incorrectly detected as not BSD!");
|
||||
Ok(is_bsd)
|
||||
is_bsd
|
||||
}
|
||||
|
||||
/// Rust sets the stack size of newly created threads to a sane value, but is at at the mercy of the
|
||||
@@ -160,13 +148,13 @@ fn detect_bsd(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
///
|
||||
/// 0.5 MiB is small enough that we'd have to drastically reduce MAX_STACK_DEPTH to less than 10, so
|
||||
/// we instead use a workaround to increase the main thread size.
|
||||
fn has_small_stack(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
fn has_small_stack(_: &Target) -> bool {
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "netbsd")))]
|
||||
return Ok(false);
|
||||
return false;
|
||||
|
||||
// NetBSD 10 also needs this but can't find pthread_get_stacksize_np.
|
||||
#[cfg(target_os = "netbsd")]
|
||||
return Ok(true);
|
||||
return true;
|
||||
|
||||
#[cfg(any(target_os = "ios", target_os = "macos"))]
|
||||
{
|
||||
@@ -181,10 +169,7 @@ fn has_small_stack(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
// Modern macOS versions default to an 8 MiB main stack but legacy OS X have a 0.5 MiB one.
|
||||
let stack_size = unsafe { pthread_get_stacksize_np(pthread_self()) };
|
||||
const TWO_MIB: usize = 2 * 1024 * 1024 - 1;
|
||||
match stack_size {
|
||||
0..=TWO_MIB => Ok(true),
|
||||
_ => Ok(false),
|
||||
}
|
||||
stack_size <= TWO_MIB
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,51 +177,57 @@ fn setup_paths() {
|
||||
#[cfg(windows)]
|
||||
use unix_path::{Path, PathBuf};
|
||||
|
||||
fn get_path(name: &str, default: &str, onvar: &Path) -> PathBuf {
|
||||
let mut var = PathBuf::from(env::var(name).unwrap_or(default.to_string()));
|
||||
if var.is_relative() {
|
||||
var = onvar.join(var);
|
||||
}
|
||||
var
|
||||
fn overridable_path(env_var_name: &str, f: impl FnOnce(Option<String>) -> PathBuf) -> PathBuf {
|
||||
rsconf::rebuild_if_env_changed(env_var_name);
|
||||
let path = f(env_var(env_var_name));
|
||||
rsconf::set_env_value(env_var_name, path.to_str().unwrap());
|
||||
path
|
||||
}
|
||||
|
||||
let prefix = PathBuf::from(env::var("PREFIX").unwrap_or("/usr/local".to_string()));
|
||||
rsconf::rebuild_if_env_changed("PREFIX");
|
||||
rsconf::set_env_value("PREFIX", prefix.to_str().unwrap());
|
||||
|
||||
let datadir = get_path("DATADIR", "share/", &prefix);
|
||||
|
||||
let sysconfdir = get_path(
|
||||
"SYSCONFDIR",
|
||||
// Embedded builds use "/etc," not "./share/etc".
|
||||
if cfg!(feature = "embed-data") {
|
||||
"/etc/"
|
||||
fn join_if_relative(parent_if_relative: &Path, path: String) -> PathBuf {
|
||||
let path = PathBuf::from(path);
|
||||
if path.is_relative() {
|
||||
parent_if_relative.join(path)
|
||||
} else {
|
||||
"etc/"
|
||||
},
|
||||
&datadir,
|
||||
);
|
||||
rsconf::set_env_value("SYSCONFDIR", sysconfdir.to_str().unwrap());
|
||||
rsconf::rebuild_if_env_changed("SYSCONFDIR");
|
||||
path
|
||||
}
|
||||
}
|
||||
|
||||
let prefix = overridable_path("PREFIX", |env_prefix| {
|
||||
PathBuf::from(env_prefix.unwrap_or("/usr/local".to_string()))
|
||||
});
|
||||
|
||||
let datadir = join_if_relative(&prefix, env_var("DATADIR").unwrap_or("share/".to_string()));
|
||||
rsconf::rebuild_if_env_changed("DATADIR");
|
||||
#[cfg(not(feature = "embed-data"))]
|
||||
rsconf::set_env_value("DATADIR", datadir.to_str().unwrap());
|
||||
|
||||
overridable_path("SYSCONFDIR", |env_sysconfdir| {
|
||||
join_if_relative(
|
||||
&datadir,
|
||||
env_sysconfdir.unwrap_or(
|
||||
// Embedded builds use "/etc," not "./share/etc".
|
||||
if cfg!(feature = "embed-data") {
|
||||
"/etc/"
|
||||
} else {
|
||||
"etc/"
|
||||
}
|
||||
.to_string(),
|
||||
),
|
||||
)
|
||||
});
|
||||
|
||||
#[cfg(not(feature = "embed-data"))]
|
||||
{
|
||||
rsconf::set_env_value("DATADIR", datadir.to_str().unwrap());
|
||||
rsconf::rebuild_if_env_changed("DATADIR");
|
||||
|
||||
let bindir = get_path("BINDIR", "bin/", &prefix);
|
||||
rsconf::set_env_value("BINDIR", bindir.to_str().unwrap());
|
||||
rsconf::rebuild_if_env_changed("BINDIR");
|
||||
|
||||
let localedir = get_path("LOCALEDIR", "locale/", &datadir);
|
||||
let localedir = localedir.to_str().unwrap();
|
||||
assert!(!localedir.is_empty(), "empty LOCALEDIR is not supported");
|
||||
rsconf::set_env_value("LOCALEDIR", localedir);
|
||||
rsconf::rebuild_if_env_changed("LOCALEDIR");
|
||||
|
||||
let docdir = get_path("DOCDIR", "doc/fish", &datadir);
|
||||
rsconf::set_env_value("DOCDIR", docdir.to_str().unwrap());
|
||||
rsconf::rebuild_if_env_changed("DOCDIR");
|
||||
overridable_path("BINDIR", |env_bindir| {
|
||||
join_if_relative(&prefix, env_bindir.unwrap_or("bin/".to_string()))
|
||||
});
|
||||
overridable_path("LOCALEDIR", |env_localedir| {
|
||||
join_if_relative(&datadir, env_localedir.unwrap_or("locale/".to_string()))
|
||||
});
|
||||
overridable_path("DOCDIR", |env_docdir| {
|
||||
join_if_relative(&datadir, env_docdir.unwrap_or("doc/fish".to_string()))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +235,7 @@ fn get_version(src_dir: &Path) -> String {
|
||||
use std::fs::read_to_string;
|
||||
use std::process::Command;
|
||||
|
||||
if let Ok(var) = std::env::var("FISH_BUILD_VERSION") {
|
||||
if let Some(var) = env_var("FISH_BUILD_VERSION") {
|
||||
return var;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,8 +43,16 @@ fi
|
||||
# Currently, all builds are debug builds.
|
||||
build_dir="$target_dir/debug"
|
||||
|
||||
if [ -n "$FISH_TEST_MAX_CONCURRENCY" ]; then
|
||||
export RUST_TEST_THREADS="$FISH_TEST_MAX_CONCURRENCY"
|
||||
export CARGO_BUILD_JOBS="$FISH_TEST_MAX_CONCURRENCY"
|
||||
fi
|
||||
|
||||
template_file=$(mktemp)
|
||||
FISH_GETTEXT_EXTRACTION_FILE=$template_file cargo build --workspace --all-targets --features=gettext-extract
|
||||
(
|
||||
export FISH_GETTEXT_EXTRACTION_FILE="$template_file"
|
||||
cargo build --workspace --all-targets --features=gettext-extract
|
||||
)
|
||||
if $lint; then
|
||||
PATH="$build_dir:$PATH" "$workspace_root/build_tools/style.fish" --all --check
|
||||
for features in "" --no-default-features; do
|
||||
|
||||
@@ -19,7 +19,7 @@ begin
|
||||
echo ""
|
||||
end
|
||||
|
||||
set -g workspace_root (status dirname)/..
|
||||
set -g workspace_root (path resolve (status dirname)/..)
|
||||
|
||||
set -l rust_extraction_file
|
||||
if set -l --query _flag_use_existing_template
|
||||
@@ -27,20 +27,30 @@ begin
|
||||
else
|
||||
set rust_extraction_file (mktemp)
|
||||
# We need to build to ensure that the proc macro for extracting strings runs.
|
||||
FISH_GETTEXT_EXTRACTION_FILE=$rust_extraction_file cargo check --features=gettext-extract
|
||||
FISH_GETTEXT_EXTRACTION_FILE=$rust_extraction_file cargo check --no-default-features --features=gettext-extract
|
||||
or exit 1
|
||||
end
|
||||
|
||||
function mark_section
|
||||
set -l section_name $argv[1]
|
||||
echo 'msgid "fish-section-'$section_name'"'
|
||||
echo 'msgstr ""'
|
||||
echo ''
|
||||
end
|
||||
|
||||
mark_section tier1-from-rust
|
||||
|
||||
# Get rid of duplicates and sort.
|
||||
msguniq --no-wrap --strict --sort-output $rust_extraction_file
|
||||
msguniq --no-wrap --sort-output $rust_extraction_file
|
||||
or exit 1
|
||||
|
||||
if not set -l --query _flag_use_existing_template
|
||||
rm $rust_extraction_file
|
||||
end
|
||||
|
||||
function extract_fish_script_messages --argument-names regex
|
||||
|
||||
function extract_fish_script_messages_impl
|
||||
set -l regex $argv[1]
|
||||
set -e argv[1]
|
||||
# Using xgettext causes more trouble than it helps.
|
||||
# This is due to handling of escaping in fish differing from formats xgettext understands
|
||||
# (e.g. POSIX shell strings).
|
||||
@@ -59,24 +69,74 @@ begin
|
||||
# 5. Double quotes are escaped, such that they are not interpreted as the start or end of
|
||||
# a msgid.
|
||||
# 6. We transform the string into the format expected in a PO file.
|
||||
cat $share_dir/config.fish $share_dir/completions/*.fish $share_dir/functions/*.fish |
|
||||
cat $argv |
|
||||
string replace --filter --regex $regex '$1' |
|
||||
string unescape |
|
||||
sort -u |
|
||||
sed -E -e 's_\\\\_\\\\\\\\_g' -e 's_"_\\\\"_g' -e 's_^(.*)$_msgid "\1"\nmsgstr ""\n_'
|
||||
end
|
||||
|
||||
function extract_fish_script_messages
|
||||
set -l tier $argv[1]
|
||||
set -e argv[1]
|
||||
if not set -q argv[1]
|
||||
return
|
||||
end
|
||||
# This regex handles explicit requests to translate a message. These are more important to translate
|
||||
# than messages which should be implicitly translated.
|
||||
set -l explicit_regex '.*\( *_ (([\'"]).+?(?<!\\\\)\\2) *\).*'
|
||||
mark_section "$tier-from-script-explicitly-added"
|
||||
extract_fish_script_messages_impl $explicit_regex $argv
|
||||
|
||||
# This regex handles descriptions for `complete` and `function` statements. These messages are not
|
||||
# particularly important to translate. Hence the "implicit" label.
|
||||
set -l implicit_regex '^(?:\s|and |or )*(?:complete|function).*? (?:-d|--description) (([\'"]).+?(?<!\\\\)\\2).*'
|
||||
mark_section "$tier-from-script-implicitly-added"
|
||||
extract_fish_script_messages_impl $implicit_regex $argv
|
||||
end
|
||||
|
||||
set -g share_dir $workspace_root/share
|
||||
|
||||
# This regex handles explicit requests to translate a message. These are more important to translate
|
||||
# than messages which should be implicitly translated.
|
||||
set -l explicit_regex '.*\( *_ (([\'"]).+?(?<!\\\\)\\2) *\).*'
|
||||
extract_fish_script_messages $explicit_regex
|
||||
set -l tier1 $share_dir/config.fish
|
||||
set -l tier2
|
||||
set -l tier3
|
||||
|
||||
# This regex handles descriptions for `complete` and `function` statements. These messages are not
|
||||
# particularly important to translate. Hence the "implicit" label.
|
||||
set -l implicit_regex '^(?:\s|and |or )*(?:complete|function).*? (?:-d|--description) (([\'"]).+?(?<!\\\\)\\2).*'
|
||||
extract_fish_script_messages $implicit_regex
|
||||
for file in $share_dir/completions/*.fish $share_dir/functions/*.fish
|
||||
# set -l tier (string match -r '^# localization: .*' <$file)
|
||||
set -l tier (string replace -rf -m1 \
|
||||
'^# localization: (.*)$' '$1' <$file)
|
||||
if set -q tier[1]
|
||||
switch "$tier"
|
||||
case tier1 tier2 tier3
|
||||
set -a $tier $file
|
||||
case 'skip*'
|
||||
case '*'
|
||||
echo >&2 "$file:1 unexpected localization tier: $tier"
|
||||
exit 1
|
||||
end
|
||||
continue
|
||||
end
|
||||
set -l dirname (path basename (path dirname $file))
|
||||
set -l command_name (path basename --no-extension $file)
|
||||
if test $dirname = functions &&
|
||||
string match -q -- 'fish_*' $command_name
|
||||
set -a tier1 $file
|
||||
continue
|
||||
end
|
||||
if test $dirname != completions
|
||||
echo >&2 "$file:1 missing localization tier for function file"
|
||||
exit 1
|
||||
end
|
||||
if test -e $workspace_root/doc_src/cmds/$command_name.rst
|
||||
set -a tier1 $file
|
||||
else
|
||||
set -a tier3 $file
|
||||
end
|
||||
end
|
||||
|
||||
extract_fish_script_messages tier1 $tier1
|
||||
extract_fish_script_messages tier2 $tier2
|
||||
extract_fish_script_messages tier3 $tier3
|
||||
end |
|
||||
# At this point, all extracted strings have been written to stdout,
|
||||
# starting with the ones taken from the Rust sources,
|
||||
|
||||
@@ -53,14 +53,14 @@ previous_minor_version=${previous_version%.*}
|
||||
)
|
||||
fi
|
||||
|
||||
printf %s "$(awk <"$workspace_root/CHANGELOG.rst" '
|
||||
printf '%s\n' "$(awk <"$workspace_root/CHANGELOG.rst" '
|
||||
NR <= 2 || /^\.\. ignore / { next }
|
||||
/^===/ { exit }
|
||||
{ print }
|
||||
' | sed '$d')" |
|
||||
sed -e '$s/^----*$//' # Remove spurious transitions at the end of the document.
|
||||
|
||||
if [ "$minor_version" != "$previous_minor_version" ]; then
|
||||
if [ "$minor_version" != "$previous_minor_version" ]; then {
|
||||
JoinEscaped() {
|
||||
sed 's/\S/\\&/g' |
|
||||
awk '
|
||||
@@ -79,7 +79,7 @@ previous_minor_version=${previous_version%.*}
|
||||
echo
|
||||
printf "Welcome back our returning committers: "
|
||||
JoinEscaped <"$relnotes_tmp/committers-returning"
|
||||
fi
|
||||
} fi
|
||||
echo
|
||||
echo "---"
|
||||
echo
|
||||
|
||||
@@ -32,6 +32,7 @@ done
|
||||
|
||||
repo_root="$(dirname "$0")/.."
|
||||
fish_site=$repo_root/../fish-site
|
||||
fish_site_repo=git@github.com:$repository_owner/fish-site
|
||||
|
||||
for path in . "$fish_site"
|
||||
do
|
||||
@@ -42,6 +43,13 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
(
|
||||
cd "$fish_site"
|
||||
[ "$(git rev-parse HEAD)" = \
|
||||
"$(git ls-remote "$fish_site_repo" refs/heads/master |
|
||||
awk '{print $1}')" ]
|
||||
)
|
||||
|
||||
if git tag | grep -qxF "$version"; then
|
||||
echo >&2 "$0: tag $version already exists"
|
||||
exit 1
|
||||
@@ -136,7 +144,10 @@ rm -rf "$tmpdir"
|
||||
cd "$fish_site"
|
||||
make
|
||||
git add -u
|
||||
! git ls-files --others --exclude-standard | grep .
|
||||
git add docs
|
||||
if git ls-files --others --exclude-standard | grep .; then
|
||||
exit 1
|
||||
fi
|
||||
git commit --message="$(printf %s "\
|
||||
| Release $version (docs)
|
||||
|
|
||||
@@ -144,15 +155,21 @@ rm -rf "$tmpdir"
|
||||
" | sed 's,^\s*| \?,,')"
|
||||
)
|
||||
|
||||
# Approve macos-codesign
|
||||
# TODO what if current user can't approve?
|
||||
gh_pending_deployments() {
|
||||
gh_api_repo() {
|
||||
path=$1
|
||||
shift
|
||||
command gh api \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
"/repos/$repository_owner/fish-shell/actions/runs/$run_id/pending_deployments" \
|
||||
"/repos/$repository_owner/fish-shell/$path" \
|
||||
"$@"
|
||||
}
|
||||
|
||||
# Approve macos-codesign
|
||||
# TODO what if current user can't approve?
|
||||
gh_pending_deployments() {
|
||||
gh_api_repo "actions/runs/$run_id/pending_deployments" "$@"
|
||||
}
|
||||
while {
|
||||
environment_id=$(gh_pending_deployments | jq .[].environment.id)
|
||||
[ -z "$environment_id" ]
|
||||
@@ -167,7 +184,7 @@ echo '
|
||||
"comment": "Approved via ./build_tools/release.sh"
|
||||
}
|
||||
' |
|
||||
gh_pending_deployments -XPOST --input=-
|
||||
gh_pending_deployments --method POST --input=-
|
||||
|
||||
# Await completion.
|
||||
gh run watch "$run_id"
|
||||
@@ -184,7 +201,10 @@ done
|
||||
cd "$fish_site"
|
||||
make new-release
|
||||
git add -u
|
||||
! git ls-files --others --exclude-standard | grep .
|
||||
git add docs
|
||||
if git ls-files --others --exclude-standard | grep .; then
|
||||
exit 1
|
||||
fi
|
||||
git commit --message="$(printf %s "\
|
||||
| Release $version (release list update)
|
||||
|
|
||||
@@ -192,12 +212,12 @@ done
|
||||
" | sed 's,^\s*| \?,,')"
|
||||
# This takes care to support remote names that are different from
|
||||
# fish-shell remote name. Also, support detached HEAD state.
|
||||
git push git@github.com:$repository_owner/fish-site HEAD:master
|
||||
git push "$fish_site_repo" HEAD:master
|
||||
)
|
||||
|
||||
if [ -n "$integration_branch" ]; then
|
||||
if [ -n "$integration_branch" ]; then {
|
||||
git push $remote "$version^{commit}":refs/heads/$integration_branch
|
||||
else
|
||||
} else {
|
||||
changelog=$(cat - CHANGELOG.rst <<EOF
|
||||
fish ?.?.? (released ???)
|
||||
=========================
|
||||
@@ -207,23 +227,27 @@ EOF
|
||||
printf %s\\n "$changelog" >CHANGELOG.rst
|
||||
CommitVersion ${version}-snapshot "start new cycle"
|
||||
git push $remote HEAD:master
|
||||
fi
|
||||
|
||||
# TODO This can currently require a TTY for editing and password
|
||||
# prompts.
|
||||
if [ "$repository_owner" = fish-shell ]; then {
|
||||
mail=$(mktemp)
|
||||
cat >$mail <<EOF
|
||||
From: $(git var GIT_AUTHOR_IDENT | sed 's/ [0-9]* +[0-9]*$//')
|
||||
Subject: fish $version released
|
||||
|
||||
See https://github.com/fish-shell/fish-shell/releases/tag/$version
|
||||
EOF
|
||||
git send-email --suppress-cc=all --confirm=always $mail \
|
||||
--to="fish-users Mailing List <fish-users@lists.sourceforge.net>"
|
||||
rm $mail
|
||||
} fi
|
||||
|
||||
milestone_number=$(
|
||||
gh_api_repo milestones?state=open |
|
||||
jq '.[] | select(.title == "fish '"$version"'") | .number'
|
||||
)
|
||||
gh_api_repo milestones/$milestone_number --method PATCH \
|
||||
--raw-field state=closed
|
||||
|
||||
next_patch_version=$(
|
||||
echo "$version" | awk -F. '
|
||||
NF == 3 && $3 ~ /[0-9]+/ {
|
||||
printf "%s.%s.%s", $1, $2, $3+1
|
||||
}
|
||||
'
|
||||
)
|
||||
if [ -n "$next_patch_version" ]; then
|
||||
gh_api_repo milestones --method POST \
|
||||
--raw-field title="fish $next_patch_version"
|
||||
fi
|
||||
|
||||
exit
|
||||
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ if test $all = yes
|
||||
end
|
||||
end
|
||||
set fish_files $workspace_root/{benchmarks,build_tools,etc,share}/**.fish
|
||||
set python_files {doc_src,share,tests}/**.py
|
||||
set python_files $workspace_root
|
||||
else
|
||||
# Format the files specified as arguments.
|
||||
set -l files $argv
|
||||
@@ -76,19 +76,19 @@ if set -q fish_files[1]
|
||||
end
|
||||
|
||||
if set -q python_files[1]
|
||||
if not type -q black
|
||||
if not type -q ruff
|
||||
echo
|
||||
echo $yellow'Please install `black` to style python'$normal
|
||||
echo $yellow'Please install `ruff` to style python'$normal
|
||||
exit 127
|
||||
end
|
||||
echo === Running "$green"black"$normal"
|
||||
echo === Running "$green"ruff format"$normal"
|
||||
if set -l -q _flag_check
|
||||
if not black --check $python_files
|
||||
if not ruff format --check $python_files
|
||||
echo $red"Python files are not formatted correctly."$normal
|
||||
exit 1
|
||||
end
|
||||
else
|
||||
black $python_files
|
||||
ruff format $python_files
|
||||
end
|
||||
end
|
||||
|
||||
@@ -101,7 +101,7 @@ end
|
||||
echo === Running "$green"rustfmt"$normal"
|
||||
if set -l -q _flag_check
|
||||
if set -l -q _flag_all
|
||||
if not cargo fmt --check
|
||||
if not cargo fmt --all --check
|
||||
echo $red"Rust files are not formatted correctly."$normal
|
||||
exit 1
|
||||
end
|
||||
@@ -115,7 +115,7 @@ if set -l -q _flag_check
|
||||
end
|
||||
else
|
||||
if set -l -q _flag_all
|
||||
cargo fmt
|
||||
cargo fmt --all
|
||||
else
|
||||
if set -q rust_files[1]
|
||||
rustfmt $rust_files
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
set -gx LC_ALL C.UTF-8
|
||||
|
||||
set -l build_tools (status dirname)
|
||||
set -g tmpdir
|
||||
set -l po_dir $build_tools/../po
|
||||
|
||||
set -l extract
|
||||
@@ -46,8 +45,8 @@ if test -z $argv[1]
|
||||
else
|
||||
set -l po_dir_id (stat --format='%d:%i' -- $po_dir)
|
||||
for arg in $argv
|
||||
set -l arg_dir_id (stat --format='%d:%i' -- (dirname $arg))
|
||||
if test $po_dir_id != $arg_dir_id
|
||||
set -l arg_dir_id (stat --format='%d:%i' -- (dirname $arg) 2>/dev/null)
|
||||
if test $po_dir_id != "$arg_dir_id"
|
||||
echo "Argument $arg is not a file in the directory $(realpath $po_dir)."
|
||||
echo "Non-option arguments must specify paths to files in this directory."
|
||||
echo ""
|
||||
@@ -99,17 +98,50 @@ if set -l --query _flag_dry_run
|
||||
cp -r $po_dir/* $tmpdir
|
||||
end
|
||||
|
||||
# This is used to identify lines which should be set here via $header_lines.
|
||||
# Make sure that this prefix does not appear elsewhere in the file and only contains characters
|
||||
# without special meaning in a sed pattern.
|
||||
set -g header_prefix "# fish-note-sections: "
|
||||
|
||||
function print_header
|
||||
set -l header_lines \
|
||||
"Translations are divided into sections, each starting with a fish-section-* pseudo-message." \
|
||||
"The first few sections are more important." \
|
||||
"Ignore the tier3 sections unless you have a lot of time."
|
||||
for line in $header_lines
|
||||
printf '%s%s\n' $header_prefix $line
|
||||
end
|
||||
end
|
||||
|
||||
function merge_po_files --argument-names template_file po_file
|
||||
msgmerge --no-wrap --update --no-fuzzy-matching --backup=none --quiet \
|
||||
$po_file $template_file
|
||||
or cleanup_exit
|
||||
set -l new_po_file (mktemp) # TODO Remove on failure.
|
||||
# Remove obsolete messages instead of keeping them as #~ entries.
|
||||
and msgattrib --no-wrap --no-obsolete -o $new_po_file $po_file
|
||||
or cleanup_exit
|
||||
|
||||
begin
|
||||
print_header
|
||||
# Paste PO file without old header lines.
|
||||
sed '/^'$header_prefix'/d' $new_po_file
|
||||
end >$po_file
|
||||
rm $new_po_file
|
||||
end
|
||||
|
||||
for po_file in $po_files
|
||||
if set --query tmpdir[1]
|
||||
set po_file $tmpdir/(basename $po_file)
|
||||
end
|
||||
if set -l --query po
|
||||
if test -e $po_file
|
||||
msgmerge --no-wrap --update --no-fuzzy-matching --backup=none --quiet $po_file $template_file
|
||||
and msgattrib --no-wrap --no-obsolete -o $po_file $po_file
|
||||
or cleanup_exit
|
||||
merge_po_files $template_file $po_file
|
||||
else
|
||||
cp $template_file $po_file
|
||||
begin
|
||||
print_header
|
||||
cat $template_file
|
||||
end >$po_file
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,21 @@
|
||||
use std::{borrow::Cow, env, path::Path};
|
||||
use std::{borrow::Cow, env, os::unix::ffi::OsStrExt, path::Path};
|
||||
|
||||
pub fn env_var(name: &str) -> Option<String> {
|
||||
let err = match env::var(name) {
|
||||
Ok(p) => return Some(p),
|
||||
Err(err) => err,
|
||||
};
|
||||
use env::VarError::*;
|
||||
match err {
|
||||
NotPresent => None,
|
||||
NotUnicode(os_string) => {
|
||||
panic!(
|
||||
"Environment variable {name} is not valid Unicode: {:?}",
|
||||
os_string.as_bytes()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn workspace_root() -> &'static Path {
|
||||
let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
|
||||
@@ -12,7 +29,7 @@ fn cargo_target_dir() -> Cow<'static, Path> {
|
||||
}
|
||||
|
||||
pub fn fish_build_dir() -> Cow<'static, Path> {
|
||||
// FISH_BUILD_DIR is set by CMake, if we are using it.
|
||||
// This is set if using CMake.
|
||||
option_env!("FISH_BUILD_DIR")
|
||||
.map(|d| Cow::Borrowed(Path::new(d)))
|
||||
.unwrap_or(cargo_target_dir())
|
||||
|
||||
@@ -14,12 +14,9 @@ fn main() {
|
||||
|
||||
#[cfg(not(clippy))]
|
||||
fn build_man(man_dir: &Path) {
|
||||
use std::{
|
||||
env,
|
||||
process::{Command, Stdio},
|
||||
};
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
use fish_build_helper::workspace_root;
|
||||
use fish_build_helper::{env_var, workspace_root};
|
||||
|
||||
let workspace_root = workspace_root();
|
||||
|
||||
@@ -47,7 +44,7 @@ fn build_man(man_dir: &Path) {
|
||||
let _ = std::fs::create_dir_all(sec1_str);
|
||||
|
||||
rsconf::rebuild_if_env_changed("FISH_BUILD_DOCS");
|
||||
if env::var("FISH_BUILD_DOCS") == Ok("0".to_string()) {
|
||||
if env_var("FISH_BUILD_DOCS") == Some("0".to_string()) {
|
||||
rsconf::warn!("Skipping man pages because $FISH_BUILD_DOCS is set to 0");
|
||||
return;
|
||||
}
|
||||
@@ -64,7 +61,7 @@ fn build_man(man_dir: &Path) {
|
||||
.spawn()
|
||||
{
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
|
||||
if env::var("FISH_BUILD_DOCS") == Ok("1".to_string()) {
|
||||
if env_var("FISH_BUILD_DOCS") == Some("1".to_string()) {
|
||||
panic!("Could not find sphinx-build to build man pages.\nInstall sphinx or disable building the docs by setting $FISH_BUILD_DOCS=0.");
|
||||
}
|
||||
rsconf::warn!("Cannot find sphinx-build to build man pages.");
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
use std::{
|
||||
env,
|
||||
ffi::OsStr,
|
||||
path::{Path, PathBuf},
|
||||
process::Command,
|
||||
process::{Command, Stdio},
|
||||
};
|
||||
|
||||
use fish_build_helper::env_var;
|
||||
|
||||
fn main() {
|
||||
let cache_dir =
|
||||
PathBuf::from(fish_build_helper::fish_build_dir()).join("fish-localization-map-cache");
|
||||
@@ -27,14 +28,18 @@ fn embed_localizations(cache_dir: &Path) {
|
||||
std::fs::create_dir_all(cache_dir).unwrap();
|
||||
|
||||
let localization_map_path =
|
||||
Path::new(&env::var("OUT_DIR").unwrap()).join("localization_maps.rs");
|
||||
Path::new(&env_var("OUT_DIR").unwrap()).join("localization_maps.rs");
|
||||
let mut localization_map_file = BufWriter::new(File::create(&localization_map_path).unwrap());
|
||||
|
||||
// This will become a map which maps from language identifiers to maps containing localizations
|
||||
// for the respective language.
|
||||
let mut catalogs = phf_codegen::Map::new();
|
||||
|
||||
match Command::new("msgfmt").arg("-h").status() {
|
||||
match Command::new("msgfmt")
|
||||
.arg("-h")
|
||||
.stdout(Stdio::null())
|
||||
.status()
|
||||
{
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
|
||||
rsconf::warn!(
|
||||
"Cannot find msgfmt to build gettext message catalogs. Localization will not work."
|
||||
@@ -97,6 +102,12 @@ fn embed_localizations(cache_dir: &Path) {
|
||||
.arg(&po_file_path)
|
||||
.output()
|
||||
.unwrap();
|
||||
if !output.status.success() {
|
||||
panic!(
|
||||
"msgfmt failed:\n{}",
|
||||
String::from_utf8(output.stderr).unwrap()
|
||||
);
|
||||
}
|
||||
let mo_data = output.stdout;
|
||||
|
||||
// Extract map from MO data.
|
||||
|
||||
@@ -15,7 +15,7 @@ pub enum Arg<'a> {
|
||||
#[cfg(feature = "widestring")]
|
||||
WString(WString),
|
||||
UInt(u64),
|
||||
SInt(i64, u8), // signed integers track their width as the number of bits
|
||||
SInt(i64),
|
||||
Float(f64),
|
||||
USizeRef(&'a mut usize), // for use with %n
|
||||
}
|
||||
@@ -59,7 +59,7 @@ pub fn as_str<'s>(&'s self, storage: &'s mut String) -> Result<&'s str, Error>
|
||||
pub fn as_uint(&self) -> Result<u64, Error> {
|
||||
match *self {
|
||||
Arg::UInt(u) => Ok(u),
|
||||
Arg::SInt(i, _w) => i.try_into().map_err(|_| Error::Overflow),
|
||||
Arg::SInt(i) => i.try_into().map_err(|_| Error::Overflow),
|
||||
_ => Err(Error::BadArgType),
|
||||
}
|
||||
}
|
||||
@@ -68,25 +68,18 @@ pub fn as_uint(&self) -> Result<u64, Error> {
|
||||
pub fn as_sint(&self) -> Result<i64, Error> {
|
||||
match *self {
|
||||
Arg::UInt(u) => u.try_into().map_err(|_| Error::Overflow),
|
||||
Arg::SInt(i, _w) => Ok(i),
|
||||
Arg::SInt(i) => Ok(i),
|
||||
_ => Err(Error::BadArgType),
|
||||
}
|
||||
}
|
||||
|
||||
// If this is a signed value, then return the sign (true if negative) and the magnitude,
|
||||
// masked to the value's width. This allows for e.g. -1 to be returned as 0xFF, 0xFFFF, etc.
|
||||
// depending on the original width.
|
||||
// If this is an unsigned value, simply return (false, u64).
|
||||
pub fn as_wrapping_sint(&self) -> Result<(bool, u64), Error> {
|
||||
/// Unwraps [`Arg::UInt`] to [`u64`].
|
||||
/// Unwraps [`Arg::SInt`] and casts the [`i64`] to [`u64`].
|
||||
/// Calling this on other variants of `[Arg]` is an error.
|
||||
pub fn as_wrapping_sint(&self) -> Result<u64, Error> {
|
||||
match *self {
|
||||
Arg::UInt(u) => Ok((false, u)),
|
||||
Arg::SInt(i, w) => {
|
||||
// Need to shift twice in case w is 64.
|
||||
debug_assert!(w > 0);
|
||||
let mask = ((1u64 << (w - 1)) << 1).wrapping_sub(1);
|
||||
let ui = (i as u64) & mask;
|
||||
Ok((i < 0, ui))
|
||||
}
|
||||
Arg::UInt(u) => Ok(u),
|
||||
Arg::SInt(i) => Ok(i as u64),
|
||||
_ => Err(Error::BadArgType),
|
||||
}
|
||||
}
|
||||
@@ -97,7 +90,7 @@ pub fn as_float(&self) -> Result<f64, Error> {
|
||||
match *self {
|
||||
Arg::Float(f) => Ok(f),
|
||||
Arg::UInt(u) => Ok(u as f64),
|
||||
Arg::SInt(i, _w) => Ok(i as f64),
|
||||
Arg::SInt(i) => Ok(i as f64),
|
||||
_ => Err(Error::BadArgType),
|
||||
}
|
||||
}
|
||||
@@ -181,7 +174,7 @@ macro_rules! impl_to_arg {
|
||||
$(
|
||||
impl<'a> ToArg<'a> for $t {
|
||||
fn to_arg(self) -> Arg<'a> {
|
||||
Arg::SInt(self as i64, <$t>::BITS as u8)
|
||||
Arg::SInt(self as i64)
|
||||
}
|
||||
}
|
||||
)*
|
||||
@@ -211,8 +204,6 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_to_arg() {
|
||||
const SIZE_WIDTH: u8 = isize::BITS as u8;
|
||||
|
||||
assert!(matches!("test".to_arg(), Arg::Str("test")));
|
||||
assert!(matches!(String::from("test").to_arg(), Arg::Str(_)));
|
||||
#[cfg(feature = "widestring")]
|
||||
@@ -224,17 +215,17 @@ fn test_to_arg() {
|
||||
assert!(matches!('x'.to_arg(), Arg::UInt(120)));
|
||||
let mut usize_val: usize = 0;
|
||||
assert!(matches!((&mut usize_val).to_arg(), Arg::USizeRef(_)));
|
||||
assert!(matches!(42i8.to_arg(), Arg::SInt(42, 8)));
|
||||
assert!(matches!(42i16.to_arg(), Arg::SInt(42, 16)));
|
||||
assert!(matches!(42i32.to_arg(), Arg::SInt(42, 32)));
|
||||
assert!(matches!(42i64.to_arg(), Arg::SInt(42, 64)));
|
||||
assert!(matches!(42isize.to_arg(), Arg::SInt(42, SIZE_WIDTH)));
|
||||
assert!(matches!(42i8.to_arg(), Arg::SInt(42)));
|
||||
assert!(matches!(42i16.to_arg(), Arg::SInt(42)));
|
||||
assert!(matches!(42i32.to_arg(), Arg::SInt(42)));
|
||||
assert!(matches!(42i64.to_arg(), Arg::SInt(42)));
|
||||
assert!(matches!(42isize.to_arg(), Arg::SInt(42)));
|
||||
|
||||
assert_eq!((-42i8).to_arg(), Arg::SInt(-42, 8));
|
||||
assert_eq!((-42i16).to_arg(), Arg::SInt(-42, 16));
|
||||
assert_eq!((-42i32).to_arg(), Arg::SInt(-42, 32));
|
||||
assert_eq!((-42i64).to_arg(), Arg::SInt(-42, 64));
|
||||
assert_eq!((-42isize).to_arg(), Arg::SInt(-42, SIZE_WIDTH));
|
||||
assert_eq!((-42i8).to_arg(), Arg::SInt(-42));
|
||||
assert_eq!((-42i16).to_arg(), Arg::SInt(-42));
|
||||
assert_eq!((-42i32).to_arg(), Arg::SInt(-42));
|
||||
assert_eq!((-42i64).to_arg(), Arg::SInt(-42));
|
||||
assert_eq!((-42isize).to_arg(), Arg::SInt(-42));
|
||||
|
||||
assert!(matches!(42u8.to_arg(), Arg::UInt(42)));
|
||||
assert!(matches!(42u16.to_arg(), Arg::UInt(42)));
|
||||
|
||||
@@ -472,7 +472,7 @@ pub fn sprintf_locale(
|
||||
// If someone passes us a negative value, format it with the width
|
||||
// we were given.
|
||||
let lower = conv_spec.is_lower();
|
||||
let (_, uint) = arg.as_wrapping_sint()?;
|
||||
let uint = arg.as_wrapping_sint()?;
|
||||
if uint != 0 {
|
||||
if flags.alt_form {
|
||||
prefix = if lower { "0x" } else { "0X" };
|
||||
|
||||
@@ -77,7 +77,7 @@ fn write_str(&mut self, _s: &str) -> fmt::Result {
|
||||
#[test]
|
||||
fn smoke() {
|
||||
assert_fmt!("Hello, %s!", "world" => "Hello, world!");
|
||||
assert_fmt!("Hello, %ls!", "world" => "Hello, world!");
|
||||
assert_fmt!("Hello, %ls!", "world" => "Hello, world!"); // length modifier
|
||||
assert_fmt!("Hello, world! %d %%%%", 3 => "Hello, world! 3 %%");
|
||||
assert_fmt!("" => "");
|
||||
}
|
||||
@@ -225,7 +225,7 @@ fn test_int() {
|
||||
assert_fmt!("%d", -123 => "-123");
|
||||
assert_fmt!("~%d~", 148 => "~148~");
|
||||
assert_fmt!("00%dxx", -91232 => "00-91232xx");
|
||||
assert_fmt!("%x", -9232 => "ffffdbf0");
|
||||
assert_fmt!("%x", -9232 => "ffffffffffffdbf0");
|
||||
assert_fmt!("%X", 432 => "1B0");
|
||||
assert_fmt!("%09X", 432 => "0000001B0");
|
||||
assert_fmt!("%9X", 432 => " 1B0");
|
||||
@@ -234,6 +234,7 @@ fn test_int() {
|
||||
assert_fmt!("%2o", 4 => " 4");
|
||||
assert_fmt!("% 12d", -4 => " -4");
|
||||
assert_fmt!("% 12d", 48 => " 48");
|
||||
// with length modifier
|
||||
assert_fmt!("%ld", -4_i64 => "-4");
|
||||
assert_fmt!("%lld", -4_i64 => "-4");
|
||||
assert_fmt!("%lX", -4_i64 => "FFFFFFFFFFFFFFFC");
|
||||
@@ -248,6 +249,7 @@ fn test_int() {
|
||||
assert_fmt!("%9X", 492 => " 1EC");
|
||||
assert_fmt!("% 12u", 4 => " 4");
|
||||
assert_fmt!("% 12u", 48 => " 48");
|
||||
// with length modifier
|
||||
assert_fmt!("%lu", 4_u64 => "4");
|
||||
assert_fmt!("%llu", 4_u64 => "4");
|
||||
assert_fmt!("%lX", 4_u64 => "4");
|
||||
@@ -414,6 +416,7 @@ fn test_float() {
|
||||
assert_fmt1!("%f", 0.0, "0.000000");
|
||||
assert_fmt1!("%g", 0.0, "0");
|
||||
assert_fmt1!("%#g", 0.0, "0.00000");
|
||||
// with length modifier
|
||||
assert_fmt1!("%la", 0.0, "0x0p+0");
|
||||
assert_fmt1!("%le", 0.0, "0.000000e+00");
|
||||
assert_fmt1!("%lf", 0.0, "0.000000");
|
||||
@@ -430,7 +433,7 @@ fn test_float() {
|
||||
assert_fmt1!("%.4f", 1.03125, "1.0312"); /* 0x1.08p0 */
|
||||
assert_fmt1!("%.2f", 1.375, "1.38");
|
||||
assert_fmt1!("%.1f", 1.375, "1.4");
|
||||
assert_fmt1!("%.1lf", 1.375, "1.4");
|
||||
assert_fmt1!("%.1lf", 1.375, "1.4"); // length modifier
|
||||
assert_fmt1!("%.15f", 1.1, "1.100000000000000");
|
||||
assert_fmt1!("%.16f", 1.1, "1.1000000000000001");
|
||||
assert_fmt1!("%.17f", 1.1, "1.10000000000000009");
|
||||
@@ -755,8 +758,8 @@ fn test_errors() {
|
||||
sprintf_err!("%1", => BadFormatString);
|
||||
sprintf_err!("%%%k", => BadFormatString);
|
||||
sprintf_err!("%B", => BadFormatString);
|
||||
sprintf_err!("%lC", 'q' => BadFormatString);
|
||||
sprintf_err!("%lS", 'q' => BadFormatString);
|
||||
sprintf_err!("%lC", 'q' => BadFormatString); // length modifier
|
||||
sprintf_err!("%lS", 'q' => BadFormatString); // length modifier
|
||||
sprintf_err!("%d", => MissingArg);
|
||||
sprintf_err!("%d %u", 1 => MissingArg);
|
||||
sprintf_err!("%*d", 5 => MissingArg);
|
||||
|
||||
@@ -42,6 +42,6 @@ The typical use is to run something, stop it with ctrl-z, and then continue it i
|
||||
|
||||
If only 123 and 789 exist, it will still background them and print an error about 456.
|
||||
|
||||
``bg 123 banana`` or ``bg banana 123`` will complain that "banana" is not a valid job specifier.
|
||||
``bg 123 banana`` or ``bg banana 123`` will complain that "banana" is not a valid process ID.
|
||||
|
||||
``bg %2`` will background job 2.
|
||||
|
||||
@@ -48,7 +48,7 @@ This refuses to store any immediate "vault", "mysql" or "ls" calls. Commands sta
|
||||
|
||||
function fish_should_add_to_history
|
||||
# I don't want `git pull`s in my history when I'm in a specific repository
|
||||
if string match -qr '^git pull'
|
||||
if string match -qr '^git pull' -- "$argv"
|
||||
and string match -qr "^/home/me/my-secret-project/" -- (pwd -P)
|
||||
return 1
|
||||
end
|
||||
|
||||
@@ -21,7 +21,7 @@ A function is a list of commands that will be executed when the name of the func
|
||||
The following options are available:
|
||||
|
||||
**-a** *NAMES* or **--argument-names** *NAMES*
|
||||
Has to be the last option. Assigns the value of successive command-line arguments to the names given in *NAMES* (separated by space). These are the same arguments given in :envvar:`argv`, and are still available there. See also :ref:`Argument Handling <variables-argv>`.
|
||||
Assigns the value of successive command-line arguments to the names given in *NAMES* (separated by spaces). These are the same arguments given in :envvar:`argv`, and are still available there (unless ``--inherit-variable argv`` was used or one of the given *NAMES* is ``argv``). See also :ref:`Argument Handling <variables-argv>`.
|
||||
|
||||
**-d** *DESCRIPTION* or **--description** *DESCRIPTION*
|
||||
A description of what the function does, suitable as a completion description.
|
||||
@@ -40,7 +40,7 @@ The following options are available:
|
||||
Run this function when the variable *VARIABLE_NAME* changes value. Note that :program:`fish` makes no guarantees on any particular timing or even that the function will be run for every single ``set``. Rather it will be run when the variable has been set at least once, possibly skipping some values or being run when the variable has been set to the same value (except for universal variables set in other shells - only changes in the value will be picked up for those).
|
||||
|
||||
**-j** *PID* or **--on-job-exit** *PID*
|
||||
Run this function when the job containing a child process with the given process identifier *PID* exits. Instead of a PID, the string 'caller' can be specified. This is only allowed when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution.
|
||||
Run this function when the job containing a child process with the given process ID *PID* exits. Instead of a PID, the string 'caller' can be specified. This is only allowed when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution.
|
||||
This will not trigger for :doc:`disowned <disown>` jobs.
|
||||
|
||||
**-p** *PID* or **--on-process-exit** *PID*
|
||||
|
||||
@@ -72,7 +72,7 @@ Required Commands
|
||||
|
||||
``\e[0c``
|
||||
-
|
||||
- Request primary device attribute.
|
||||
- Request Primary Device Attribute.
|
||||
The terminal must respond with a CSI command that starts with the ``?`` parameter byte (so a sequence starting with ``\e[?``) and has ``c`` as final byte.
|
||||
|
||||
Failure to implement this will cause a brief pause at startup followed by a warning.
|
||||
|
||||
@@ -3,8 +3,10 @@ LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV PIP_ROOT_USER_ACTION=ignore
|
||||
|
||||
RUN apk add --no-cache \
|
||||
cmake ninja \
|
||||
bash \
|
||||
cargo \
|
||||
g++ \
|
||||
@@ -14,11 +16,15 @@ RUN apk add --no-cache \
|
||||
musl-dev \
|
||||
pcre2-dev \
|
||||
py3-pexpect \
|
||||
py3-pip \
|
||||
python3 \
|
||||
rust \
|
||||
rustfmt \
|
||||
sudo \
|
||||
tmux
|
||||
|
||||
RUN pip install --break-system-packages black
|
||||
|
||||
RUN addgroup -g 1000 fishuser
|
||||
|
||||
RUN adduser \
|
||||
|
||||
@@ -6,12 +6,15 @@ ENV LC_ALL=C.UTF-8
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
curl \
|
||||
g++-multilib \
|
||||
gettext \
|
||||
git \
|
||||
locales \
|
||||
openssl \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
|
||||
@@ -6,14 +6,17 @@ ENV LC_ALL=C.UTF-8
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
cmake ninja-build \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
cargo \
|
||||
clang \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
openssl \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
rustc \
|
||||
|
||||
@@ -6,12 +6,14 @@ ENV LC_ALL=C.UTF-8
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
cargo \
|
||||
gettext \
|
||||
git \
|
||||
locales \
|
||||
openssl \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
|
||||
@@ -6,8 +6,10 @@ ENV LC_ALL=C.UTF-8
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
cmake ninja-build \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
cargo \
|
||||
file \
|
||||
g++ \
|
||||
@@ -15,10 +17,11 @@ RUN apt-get update \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
openssl \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
rust \
|
||||
rustc \
|
||||
sudo \
|
||||
tmux \
|
||||
&& locale-gen en_US.UTF-8 \
|
||||
|
||||
@@ -5,13 +5,16 @@ ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
clang \
|
||||
curl \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
openssl \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
sudo \
|
||||
|
||||
@@ -5,13 +5,16 @@ ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
clang \
|
||||
curl \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
openssl \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
sudo \
|
||||
|
||||
@@ -5,22 +5,28 @@ ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
cmake ninja-build \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
cargo \
|
||||
clang \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
openssl \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
rustc \
|
||||
sudo \
|
||||
tmux \
|
||||
python3-pip \
|
||||
&& locale-gen en_US.UTF-8 \
|
||||
&& apt-get clean
|
||||
|
||||
RUN pip install black
|
||||
|
||||
RUN groupadd -g 1000 fishuser \
|
||||
&& useradd -p $(openssl passwd -1 fish) -d /home/fishuser -m -u 1000 -g 1000 fishuser \
|
||||
&& adduser fishuser sudo \
|
||||
|
||||
@@ -5,12 +5,16 @@ ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
adduser \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
openssl \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
tmux \
|
||||
|
||||
5466
po/pt_BR.po
5466
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
50976
po/zh_CN.po
50976
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
@@ -1 +1,2 @@
|
||||
# localization: tier1
|
||||
complete ! --wraps not
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
# localization: tier1
|
||||
complete [ --wraps test
|
||||
|
||||
@@ -1,46 +1,16 @@
|
||||
function __fish_bind_test1
|
||||
set -l args
|
||||
set -l use_keys no
|
||||
for i in (commandline -pxc)
|
||||
switch $i
|
||||
case -k --k --ke --key
|
||||
set use_keys yes
|
||||
|
||||
case "-*"
|
||||
|
||||
case "*"
|
||||
set -a args $i
|
||||
end
|
||||
end
|
||||
|
||||
switch $use_keys
|
||||
case yes
|
||||
switch (count $args)
|
||||
case 1
|
||||
return 0
|
||||
end
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
function __fish_bind_test2
|
||||
set -l args
|
||||
for i in (commandline -pxc)
|
||||
switch $i
|
||||
case "-*"
|
||||
|
||||
case "*"
|
||||
set -a args $i
|
||||
end
|
||||
end
|
||||
|
||||
switch (count $args)
|
||||
case 2
|
||||
return 0
|
||||
end
|
||||
|
||||
return 1
|
||||
set -l bind_optspecs \
|
||||
a/all \
|
||||
e/erase \
|
||||
M/mode= \
|
||||
m/sets-mode= \
|
||||
preset \
|
||||
s/silent \
|
||||
user
|
||||
|
||||
function __fish_bind_has_keys --inherit-variable bind_optspecs
|
||||
argparse $bind_optspecs -- $argv 2>/dev/null
|
||||
or return
|
||||
test (count $argv) -ge 2
|
||||
end
|
||||
|
||||
complete -c bind -f
|
||||
@@ -56,11 +26,10 @@ complete -c bind -s s -l silent -d 'Operate silently'
|
||||
complete -c bind -l preset -d 'Operate on preset bindings'
|
||||
complete -c bind -l user -d 'Operate on user bindings'
|
||||
|
||||
complete -c bind -n __fish_bind_test2 -a '(bind --function-names)' -d 'Function name' -x
|
||||
complete -c bind -n '__fish_bind_has_keys (commandline -pcx)' -a '(bind --function-names)' -d 'Function name' -x
|
||||
|
||||
function __fish_bind_complete
|
||||
argparse M/mode= m/sets-mode= preset user s/silent \
|
||||
a/all function-names list-modes e/erase -- (commandline -xpc)[2..] 2>/dev/null
|
||||
function __fish_bind_complete --inherit-variable bind_optspecs
|
||||
argparse $bind_optspecs -- (commandline -xpc)[2..] 2>/dev/null
|
||||
or return 1
|
||||
set -l token (commandline -ct)
|
||||
if test (count $argv) = 0 && set -l prefix (string match -r -- '(.*,)?(ctrl-|alt-|shift-|super-)*' $token)
|
||||
|
||||
@@ -11,7 +11,7 @@ complete -c commandline -s t -l current-token -d "Select token under cursor"
|
||||
complete -c commandline -s b -l current-buffer -d "Select entire command line (default)"
|
||||
|
||||
complete -c commandline -s c -l cut-at-cursor -d "Only return that part of the command line before the cursor"
|
||||
complete -c commandline -s f -l function -d "Inject readline functions to reader"
|
||||
complete -c commandline -s f -l function -d "execute readline function"
|
||||
complete -c commandline -s x -l tokens-expanded -d "Print a list of expanded tokens"
|
||||
|
||||
complete -c commandline -s I -l input -d "Specify command to operate on"
|
||||
|
||||
@@ -41,7 +41,7 @@ complete -c find -o empty -d "File is empty and is either a regular file or a di
|
||||
complete -c find -o executable -d "File is executable"
|
||||
complete -c find -o false -d "Always false"
|
||||
complete -c find -o fstype -d "File is on filesystem of specified type" -a "(__fish_print_filesystems)" -x
|
||||
complete -c find -o gid -d "Numeric group id of file" -x -a "(__fish_complete_group_ids)"
|
||||
complete -c find -o gid -d "Numeric group ID of file" -x -a "(__fish_complete_group_ids)"
|
||||
complete -c find -o group -d "Group name of file" -x -a "(__fish_complete_groups)"
|
||||
|
||||
complete -c find -o ilname -d "File is symlink matching specified case insensitive pattern" -x
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(barely-used)
|
||||
|
||||
set --local CONDITION '! __fish_seen_argument --short r --long required-val --short o --long optional-val'
|
||||
|
||||
complete --command fish_opt --no-files
|
||||
|
||||
@@ -1468,7 +1468,7 @@ complete -x -c git -n '__fish_git_using_command daemon' -l user-path -d 'Allow ~
|
||||
complete -f -c git -n '__fish_git_using_command daemon' -l verbose -d 'Log all details'
|
||||
complete -f -c git -n '__fish_git_using_command daemon' -l reuseaddr -d 'Reuse address when binding to listening server'
|
||||
complete -f -c git -n '__fish_git_using_command daemon' -l detach -d 'Detach from shell'
|
||||
complete -x -c git -n '__fish_git_using_command daemon' -l reuseaddr -d 'Save the process id in file'
|
||||
complete -x -c git -n '__fish_git_using_command daemon' -l reuseaddr -d 'Save the process ID in file'
|
||||
complete -x -c git -n '__fish_git_using_command daemon' -l user -d 'Change daemon\'s uid'
|
||||
complete -x -c git -n '__fish_git_using_command daemon' -l group -d 'Change daemon\'s gid'
|
||||
complete -x -c git -n '__fish_git_using_command daemon' -l enable -a 'upload-pack upload-archive receive-pack' -d 'Enable service'
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
if test -d "$__fish_data_dir/man/man1/"
|
||||
complete -c help -x -a '(__fish_print_commands)' -d 'Help for this command'
|
||||
end
|
||||
complete -c help -x -a '(__fish_print_commands)' -d 'Help for this command'
|
||||
|
||||
# Help topics in index.html
|
||||
# This was semi-automated with `grep 'class="anchor"' -A1 /usr/share/doc/fish/index.html
|
||||
@@ -122,7 +120,7 @@ complete -c help -x -a exporting-variables -d "What set -x does"
|
||||
complete -c help -x -a functions -d "How to define functions"
|
||||
complete -c help -x -a home-directory-expansion -d "~ expansion"
|
||||
complete -c help -x -a index-range-expansion -d "var[x..y] slices"
|
||||
complete -c help -x -a input-output-redirection -d "< and > redirectoins"
|
||||
complete -c help -x -a input-output-redirection -d "< and > redirections"
|
||||
complete -c help -x -a lists -d "Variables with multiple elements"
|
||||
complete -c help -x -a loops-and-blocks -d "while, for and begin"
|
||||
complete -c help -x -a more-on-universal-variables
|
||||
|
||||
@@ -4,7 +4,7 @@ if string match -eq 'GNU coreutils' (id --version 2>&1)
|
||||
complete id -s Z -l context -d "Print security context"
|
||||
complete id -s z -l zero -d "Delimit entries with NUL"
|
||||
complete id -s n -l name -d "Print name, not number"
|
||||
complete id -s g -l group -d "Print effective group id"
|
||||
complete id -s g -l group -d "Print effective group ID"
|
||||
complete id -s G -l groups -d "Print all group ids"
|
||||
complete id -s r -l real -d "Print real ID, not effective"
|
||||
complete id -s u -l user -d "Print effective user ID"
|
||||
@@ -24,7 +24,7 @@ else
|
||||
complete id -s F -d "Print full name of the user"
|
||||
complete id -s G -d "Print all group ids"
|
||||
complete id -s P -d "Print as passwd file entry"
|
||||
complete id -s g -d "Print effective group id"
|
||||
complete id -s g -d "Print effective group ID"
|
||||
complete id -s n -d "Print name, not number"
|
||||
complete id -s p -d "Human-readable output"
|
||||
complete id -s r -d "Print real ID, not effective"
|
||||
|
||||
@@ -548,8 +548,8 @@ function __fish_complete_ip
|
||||
attach "Attach process to network namespace" \
|
||||
delete "Delete network namespace" \
|
||||
set "Change network namespace attributes" \
|
||||
identify "Display network namespace for a process id" \
|
||||
pids "Display process ids of processes running in network namespace" \
|
||||
identify "Display network namespace for a process ID" \
|
||||
pids "Display process IDs of processes running in network namespace" \
|
||||
monitor "Report as network namespace names are added and deleted" \
|
||||
exec "Execute command in network namespace" \
|
||||
help "Display help" \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
complete -c jobs -s h -l help -d 'Display help and exit'
|
||||
complete -c jobs -s p -l pid -d "Show the process id of each process in the job"
|
||||
complete -c jobs -s g -l group -d "Show group id of job"
|
||||
complete -c jobs -s p -l pid -d "Show the process ID of each process in the job"
|
||||
complete -c jobs -s g -l group -d "Show group ID of job"
|
||||
complete -c jobs -s c -l command -d "Show commandname of each job"
|
||||
complete -c jobs -s l -l last -d "Only show status for last job to be started"
|
||||
complete -c jobs -s q -l quiet -l query -d "Check if a job exists without output"
|
||||
|
||||
@@ -47,7 +47,7 @@ complete -c scp -d "Local Path" -n "not string match @ -- (commandline -ct)"
|
||||
complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -a '
|
||||
(__scp_remote_target):(
|
||||
if not set -q __fish_scp_sftp
|
||||
set -l tmp (__fish_mktemp fish-scp)
|
||||
set -l tmp (__fish_mktemp_relative fish-scp)
|
||||
if scp -P(__scp2ssh_port_number) -o "BatchMode yes" -q -O $tmp (__scp_remote_target):/dev/null
|
||||
set -g __fish_scp_sftp true
|
||||
else
|
||||
|
||||
@@ -110,7 +110,7 @@ set -l maybe_filter_private_vars '
|
||||
)'
|
||||
# We do not *filter* these by the given scope because you might want to set e.g. a global to shadow a universal.
|
||||
complete -c set -n '__fish_is_nth_token 1; and not __fish_seen_argument -s e -l erase' -x -a "(set -U | $maybe_filter_private_vars | string replace ' ' \t'Universal Variable: ')"
|
||||
complete -c set -n '__fish_is_nth_token 1; and not __fish_seen_argument -s e -l erase' -x -a "(set -g | $maybe_filter_private_vars | string replace -r '^((?:history|fish_killring) ).*' '$1' | string replace ' ' \t'Global Variable: ')"
|
||||
complete -c set -n '__fish_is_nth_token 1; and not __fish_seen_argument -s e -l erase' -x -a "(set -g | $maybe_filter_private_vars | string replace -r '^((?:history|fish_killring) ).*' '\$1' | string replace ' ' \t'Global Variable: ')"
|
||||
complete -c set -n '__fish_is_nth_token 1; and not __fish_seen_argument -s e -l erase' -x -a "(set -l | $maybe_filter_private_vars | string replace ' ' \t'Local Variable: ')"
|
||||
# Complete some fish configuration variables even if they aren't set.
|
||||
complete -c set -n '__fish_is_nth_token 1; and not __fish_seen_argument -s e -l erase' -x -a "(__fish_complete_special_vars)"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
function N_ --description No-op
|
||||
# localization: skip(deprecated)
|
||||
function N_
|
||||
printf "%s" $argv
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
# returns 0 only if any argument is on of the supplied arguments
|
||||
function __fish_any_arg_in
|
||||
set -l haystack $argv
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_anyeditor --description "Print a editor to use, or an error message"
|
||||
# localization: tier1
|
||||
function __fish_anyeditor
|
||||
set -l editor
|
||||
if set -q VISUAL
|
||||
echo $VISUAL | read -at editor
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_anypager --description "Print a pager to use"
|
||||
set -l pager
|
||||
# We prefer $PAGER if we have it
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_anypython
|
||||
# Try python3 first, because that's usually faster and generally nicer.
|
||||
# Do not consider the stub /usr/bin/python3 that comes installed on Darwin to be Python
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_append -d "Internal completion function for appending string to the commandline" --argument-names sep
|
||||
set -e argv[1]
|
||||
set -l str (commandline -tc | string replace -rf "(.*$sep)[^$sep]*" '$1' | string replace -r -- '--.*=' '')
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
if not type -q apropos
|
||||
function __fish_apropos
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_argcomplete_complete
|
||||
set -lx _ARGCOMPLETE 1
|
||||
set -lx _ARGCOMPLETE_IFS \n
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
# localization: skip(private)
|
||||
function __fish_cache_put
|
||||
set -l cache_file $argv[1]
|
||||
touch $cache_file
|
||||
set -l dir (path dirname $cache_file)
|
||||
chown --reference=$dir $cache_file 2>/dev/null ||
|
||||
chown (
|
||||
stat --format '%u:%g' $dir 2>/dev/null ||
|
||||
stat -f '%u:%g' $dir
|
||||
if stat --version 2>&1 | string match -q 'BusyBox*'
|
||||
stat -c '%u:%g' $dir
|
||||
else
|
||||
stat --format '%u:%g' $dir 2>/dev/null ||
|
||||
stat -f '%u:%g' $dir
|
||||
end
|
||||
) $cache_file
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_cache_sourced_completions
|
||||
# Allow a `--name=foo` option which ends up in the filename.
|
||||
argparse -s name= -- $argv
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_cached --description "Cache the command output for a given amount of time"
|
||||
|
||||
argparse --min-args 1 --max-args 1 --stop-nonopt 't/max-age=!_validate_int --min 0' 'k/cache-key=' -- $argv
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
# This is meant to be bound to something like ctrl-c
|
||||
function __fish_cancel_commandline
|
||||
commandline -f cancel-commandline
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_change_key_bindings --argument-names bindings
|
||||
set -g __fish_active_key_bindings $bindings
|
||||
# Allow the user to set the variable universally
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_cmd__complete_args -d 'Function to generate args'
|
||||
# localization: tier3
|
||||
function __fish_cmd__complete_args
|
||||
set -l current_token (commandline -tc)
|
||||
|
||||
switch $current_token
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
# TODO: This function is deprecated. It was used in fish_clipboard_paste
|
||||
# which some users copied, so maybe leave it around for a few years.
|
||||
function __fish_commandline_is_singlequoted --description "Return 0 if the current token has an open single-quote"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_atool_archive_contents --description 'List archive contents'
|
||||
set -l cmd (commandline -cxp)
|
||||
set -e cmd[1]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# localization: tier3
|
||||
#
|
||||
# Bittorrent commands
|
||||
|
||||
function __fish_complete_bittorrent
|
||||
complete -c $argv -l max_uploads -x --description "Maximum uploads at once"
|
||||
complete -c $argv -l keepalive_interval -x --description "Number of seconds between keepalives"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# Helper function for completions that need to enumerate block devices.
|
||||
function __fish_complete_blockdevice
|
||||
set -l cmd (commandline -ct)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# This function only emits completions that might result from matches against $CDPATH. We rely on
|
||||
# the core file name completion logic to include all other possible matches.
|
||||
function __fish_complete_cd -d "Completions for the cd command"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# This function is compatible with clang, clang++, and variations thereof, and is shared
|
||||
# by clang.fish and clang++.fish.
|
||||
# We dynamically query the head at `(commandline -x)[1]` to get the correct completions.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_command --description 'Complete using all available commands'
|
||||
set -l ctoken "$(commandline -ct)"
|
||||
switch $ctoken
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_convert_options --description 'Complete Convert options' --argument-names what
|
||||
switch $what
|
||||
case format Format
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# Find directories that complete $argv[1], output them as completions
|
||||
# with description $argv[2] if defined, otherwise use 'Directory'.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_complete_docutils -d "Completions for Docutils common options" -a cmd
|
||||
# localization: tier3
|
||||
function __fish_complete_docutils -a cmd
|
||||
complete -x -c $cmd -k -a "(__fish_complete_suffix .rst .txt)"
|
||||
|
||||
# General Docutils Options
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_freedesktop_icons -d 'List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`'
|
||||
# The latest `icon-theme-spec` as of 2024-08-10 is 0.13
|
||||
# https://specifications.freedesktop.org/icon-theme-spec/latest/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_complete_ftp -d 'Complete ftp, pftp' --argument-names ftp
|
||||
# localization: tier3
|
||||
function __fish_complete_ftp --argument-names ftp
|
||||
# Common across all ftp implementations
|
||||
complete -c $ftp -xa "(__fish_print_hostnames)" -d Hostname
|
||||
complete -c $ftp -s 4 -d 'Use IPv4 only'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier3
|
||||
#
|
||||
# Completions for the gpg program.
|
||||
#
|
||||
@@ -15,7 +16,7 @@
|
||||
# removed. The remaining list of completions is still quite
|
||||
# impressive.
|
||||
|
||||
function __fish_complete_gpg -d "Internal function for gpg completion code deduplication" -a __fish_complete_gpg_command
|
||||
function __fish_complete_gpg -a __fish_complete_gpg_command
|
||||
if string match -q 'gpg (GnuPG) 1.*' ($__fish_complete_gpg_command --version 2>/dev/null)
|
||||
complete -c $__fish_complete_gpg_command -l simple-sk-checksum -d 'Integrity protect secret keys by using a SHA-1 checksum'
|
||||
complete -c $__fish_complete_gpg_command -l no-sig-create-check -d "Do not verify each signature right after creation"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Helper function for contextual autocompletion of GPG key ids
|
||||
# localization: skip(private)
|
||||
|
||||
# Helper function for contextual autocompletion of GPG key ids
|
||||
function __fish_complete_gpg_key_id -d 'Complete using gpg key ids' -a __fish_complete_gpg_command list_arg
|
||||
# Use user id as description
|
||||
set -l keyid
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Helper function for contextual autocompletion of gpg user ids
|
||||
# localization: skip(private)
|
||||
|
||||
# Helper function for contextual autocompletion of gpg user ids
|
||||
function __fish_complete_gpg_user_id -d "Complete using gpg user ids" -a __fish_complete_gpg_command list_arg
|
||||
# gpg doesn't seem to like it when you use the whole key name as a
|
||||
# completion, so we skip the <EMAIL> part and use it as a description.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_group_ids --description "Complete group IDs with group name as description"
|
||||
if command -sq getent
|
||||
getent group | string replace -f -r '^([[:alpha:]_][^:]*):[^:]*:(\d+).*' '$2\t$1'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_groups --description "Print a list of local groups, with group members as the description"
|
||||
if command -sq getent
|
||||
getent group | while read -l line
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_job_pids --description "Print a list of job PIDs and their commands"
|
||||
if set -l jobpids (jobs -p)
|
||||
# when run at the commandline, the first line of output is a header, but
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_list --argument-names div cmd prefix iprefix
|
||||
if not set -q cmd[1]
|
||||
echo "Usage:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier3
|
||||
function __fish_complete_lpr -d 'Complete lpr common options' --argument-names cmd
|
||||
complete -c $cmd -s E -d 'Forces encryption when connecting to the server'
|
||||
complete -c $cmd -s U -d 'Specifies an alternate username' -xa '(__fish_complete_users)'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user